
software.amazon.awssdk.services.datasync.model.DescribeLocationFsxOntapResponse 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.datasync.model;
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 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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeLocationFsxOntapResponse extends DataSyncResponse implements
ToCopyableBuilder {
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(DescribeLocationFsxOntapResponse::creationTime))
.setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LOCATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LocationArn").getter(getter(DescribeLocationFsxOntapResponse::locationArn))
.setter(setter(Builder::locationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocationArn").build()).build();
private static final SdkField LOCATION_URI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LocationUri").getter(getter(DescribeLocationFsxOntapResponse::locationUri))
.setter(setter(Builder::locationUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LocationUri").build()).build();
private static final SdkField PROTOCOL_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Protocol").getter(getter(DescribeLocationFsxOntapResponse::protocol)).setter(setter(Builder::protocol))
.constructor(FsxProtocol::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Protocol").build()).build();
private static final SdkField> SECURITY_GROUP_ARNS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SecurityGroupArns")
.getter(getter(DescribeLocationFsxOntapResponse::securityGroupArns))
.setter(setter(Builder::securityGroupArns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecurityGroupArns").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField STORAGE_VIRTUAL_MACHINE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StorageVirtualMachineArn").getter(getter(DescribeLocationFsxOntapResponse::storageVirtualMachineArn))
.setter(setter(Builder::storageVirtualMachineArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageVirtualMachineArn").build())
.build();
private static final SdkField FSX_FILESYSTEM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FsxFilesystemArn").getter(getter(DescribeLocationFsxOntapResponse::fsxFilesystemArn))
.setter(setter(Builder::fsxFilesystemArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FsxFilesystemArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATION_TIME_FIELD,
LOCATION_ARN_FIELD, LOCATION_URI_FIELD, PROTOCOL_FIELD, SECURITY_GROUP_ARNS_FIELD, STORAGE_VIRTUAL_MACHINE_ARN_FIELD,
FSX_FILESYSTEM_ARN_FIELD));
private final Instant creationTime;
private final String locationArn;
private final String locationUri;
private final FsxProtocol protocol;
private final List securityGroupArns;
private final String storageVirtualMachineArn;
private final String fsxFilesystemArn;
private DescribeLocationFsxOntapResponse(BuilderImpl builder) {
super(builder);
this.creationTime = builder.creationTime;
this.locationArn = builder.locationArn;
this.locationUri = builder.locationUri;
this.protocol = builder.protocol;
this.securityGroupArns = builder.securityGroupArns;
this.storageVirtualMachineArn = builder.storageVirtualMachineArn;
this.fsxFilesystemArn = builder.fsxFilesystemArn;
}
/**
*
* The time that the location was created.
*
*
* @return The time that the location was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The ARN of the FSx for ONTAP file system location.
*
*
* @return The ARN of the FSx for ONTAP file system location.
*/
public final String locationArn() {
return locationArn;
}
/**
*
* The uniform resource identifier (URI) of the FSx for ONTAP file system location.
*
*
* @return The uniform resource identifier (URI) of the FSx for ONTAP file system location.
*/
public final String locationUri() {
return locationUri;
}
/**
* Returns the value of the Protocol property for this object.
*
* @return The value of the Protocol property for this object.
*/
public final FsxProtocol protocol() {
return protocol;
}
/**
* For responses, this returns true if the service returned a value for the SecurityGroupArns 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 hasSecurityGroupArns() {
return securityGroupArns != null && !(securityGroupArns instanceof SdkAutoConstructList);
}
/**
*
* The security groups that DataSync uses to access your FSx for ONTAP file system.
*
*
* 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 #hasSecurityGroupArns} method.
*
*
* @return The security groups that DataSync uses to access your FSx for ONTAP file system.
*/
public final List securityGroupArns() {
return securityGroupArns;
}
/**
*
* The ARN of the storage virtual machine (SVM) on your FSx for ONTAP file system where you're copying data to or
* from.
*
*
* @return The ARN of the storage virtual machine (SVM) on your FSx for ONTAP file system where you're copying data
* to or from.
*/
public final String storageVirtualMachineArn() {
return storageVirtualMachineArn;
}
/**
*
* The ARN of the FSx for ONTAP file system.
*
*
* @return The ARN of the FSx for ONTAP file system.
*/
public final String fsxFilesystemArn() {
return fsxFilesystemArn;
}
@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(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(locationArn());
hashCode = 31 * hashCode + Objects.hashCode(locationUri());
hashCode = 31 * hashCode + Objects.hashCode(protocol());
hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroupArns() ? securityGroupArns() : null);
hashCode = 31 * hashCode + Objects.hashCode(storageVirtualMachineArn());
hashCode = 31 * hashCode + Objects.hashCode(fsxFilesystemArn());
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 DescribeLocationFsxOntapResponse)) {
return false;
}
DescribeLocationFsxOntapResponse other = (DescribeLocationFsxOntapResponse) obj;
return Objects.equals(creationTime(), other.creationTime()) && Objects.equals(locationArn(), other.locationArn())
&& Objects.equals(locationUri(), other.locationUri()) && Objects.equals(protocol(), other.protocol())
&& hasSecurityGroupArns() == other.hasSecurityGroupArns()
&& Objects.equals(securityGroupArns(), other.securityGroupArns())
&& Objects.equals(storageVirtualMachineArn(), other.storageVirtualMachineArn())
&& Objects.equals(fsxFilesystemArn(), other.fsxFilesystemArn());
}
/**
* 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("DescribeLocationFsxOntapResponse").add("CreationTime", creationTime())
.add("LocationArn", locationArn()).add("LocationUri", locationUri()).add("Protocol", protocol())
.add("SecurityGroupArns", hasSecurityGroupArns() ? securityGroupArns() : null)
.add("StorageVirtualMachineArn", storageVirtualMachineArn()).add("FsxFilesystemArn", fsxFilesystemArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LocationArn":
return Optional.ofNullable(clazz.cast(locationArn()));
case "LocationUri":
return Optional.ofNullable(clazz.cast(locationUri()));
case "Protocol":
return Optional.ofNullable(clazz.cast(protocol()));
case "SecurityGroupArns":
return Optional.ofNullable(clazz.cast(securityGroupArns()));
case "StorageVirtualMachineArn":
return Optional.ofNullable(clazz.cast(storageVirtualMachineArn()));
case "FsxFilesystemArn":
return Optional.ofNullable(clazz.cast(fsxFilesystemArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function