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

software.amazon.awssdk.services.fsx.model.SelfManagedActiveDirectoryAttributes 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.fsx.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.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;

/**
 * 

* The configuration of the self-managed Microsoft Active Directory (AD) directory to which the Windows File Server or * ONTAP storage virtual machine (SVM) instance is joined. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SelfManagedActiveDirectoryAttributes implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField DOMAIN_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("DomainName").getter(getter(SelfManagedActiveDirectoryAttributes::domainName)) .setter(setter(Builder::domainName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DomainName").build()).build(); private static final SdkField ORGANIZATIONAL_UNIT_DISTINGUISHED_NAME_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("OrganizationalUnitDistinguishedName") .getter(getter(SelfManagedActiveDirectoryAttributes::organizationalUnitDistinguishedName)) .setter(setter(Builder::organizationalUnitDistinguishedName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("OrganizationalUnitDistinguishedName").build()).build(); private static final SdkField FILE_SYSTEM_ADMINISTRATORS_GROUP_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("FileSystemAdministratorsGroup") .getter(getter(SelfManagedActiveDirectoryAttributes::fileSystemAdministratorsGroup)) .setter(setter(Builder::fileSystemAdministratorsGroup)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileSystemAdministratorsGroup") .build()).build(); private static final SdkField USER_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("UserName").getter(getter(SelfManagedActiveDirectoryAttributes::userName)) .setter(setter(Builder::userName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserName").build()).build(); private static final SdkField> DNS_IPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DnsIps") .getter(getter(SelfManagedActiveDirectoryAttributes::dnsIps)) .setter(setter(Builder::dnsIps)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DnsIps").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 List> SDK_FIELDS = Collections .unmodifiableList(Arrays.asList(DOMAIN_NAME_FIELD, ORGANIZATIONAL_UNIT_DISTINGUISHED_NAME_FIELD, FILE_SYSTEM_ADMINISTRATORS_GROUP_FIELD, USER_NAME_FIELD, DNS_IPS_FIELD)); private static final long serialVersionUID = 1L; private final String domainName; private final String organizationalUnitDistinguishedName; private final String fileSystemAdministratorsGroup; private final String userName; private final List dnsIps; private SelfManagedActiveDirectoryAttributes(BuilderImpl builder) { this.domainName = builder.domainName; this.organizationalUnitDistinguishedName = builder.organizationalUnitDistinguishedName; this.fileSystemAdministratorsGroup = builder.fileSystemAdministratorsGroup; this.userName = builder.userName; this.dnsIps = builder.dnsIps; } /** *

* The fully qualified domain name of the self-managed AD directory. *

* * @return The fully qualified domain name of the self-managed AD directory. */ public final String domainName() { return domainName; } /** *

* The fully qualified distinguished name of the organizational unit within the self-managed AD directory to which * the Windows File Server or ONTAP storage virtual machine (SVM) instance is joined. *

* * @return The fully qualified distinguished name of the organizational unit within the self-managed AD directory to * which the Windows File Server or ONTAP storage virtual machine (SVM) instance is joined. */ public final String organizationalUnitDistinguishedName() { return organizationalUnitDistinguishedName; } /** *

* The name of the domain group whose members have administrative privileges for the FSx file system. *

* * @return The name of the domain group whose members have administrative privileges for the FSx file system. */ public final String fileSystemAdministratorsGroup() { return fileSystemAdministratorsGroup; } /** *

* The user name for the service account on your self-managed AD domain that FSx uses to join to your AD domain. *

* * @return The user name for the service account on your self-managed AD domain that FSx uses to join to your AD * domain. */ public final String userName() { return userName; } /** * For responses, this returns true if the service returned a value for the DnsIps 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 hasDnsIps() { return dnsIps != null && !(dnsIps instanceof SdkAutoConstructList); } /** *

* A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD directory. *

*

* 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 #hasDnsIps} method. *

* * @return A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD directory. */ public final List dnsIps() { return dnsIps; } @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(domainName()); hashCode = 31 * hashCode + Objects.hashCode(organizationalUnitDistinguishedName()); hashCode = 31 * hashCode + Objects.hashCode(fileSystemAdministratorsGroup()); hashCode = 31 * hashCode + Objects.hashCode(userName()); hashCode = 31 * hashCode + Objects.hashCode(hasDnsIps() ? dnsIps() : 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 SelfManagedActiveDirectoryAttributes)) { return false; } SelfManagedActiveDirectoryAttributes other = (SelfManagedActiveDirectoryAttributes) obj; return Objects.equals(domainName(), other.domainName()) && Objects.equals(organizationalUnitDistinguishedName(), other.organizationalUnitDistinguishedName()) && Objects.equals(fileSystemAdministratorsGroup(), other.fileSystemAdministratorsGroup()) && Objects.equals(userName(), other.userName()) && hasDnsIps() == other.hasDnsIps() && Objects.equals(dnsIps(), other.dnsIps()); } /** * 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("SelfManagedActiveDirectoryAttributes").add("DomainName", domainName()) .add("OrganizationalUnitDistinguishedName", organizationalUnitDistinguishedName()) .add("FileSystemAdministratorsGroup", fileSystemAdministratorsGroup()).add("UserName", userName()) .add("DnsIps", hasDnsIps() ? dnsIps() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "DomainName": return Optional.ofNullable(clazz.cast(domainName())); case "OrganizationalUnitDistinguishedName": return Optional.ofNullable(clazz.cast(organizationalUnitDistinguishedName())); case "FileSystemAdministratorsGroup": return Optional.ofNullable(clazz.cast(fileSystemAdministratorsGroup())); case "UserName": return Optional.ofNullable(clazz.cast(userName())); case "DnsIps": return Optional.ofNullable(clazz.cast(dnsIps())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SelfManagedActiveDirectoryAttributes) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The fully qualified domain name of the self-managed AD directory. *

* * @param domainName * The fully qualified domain name of the self-managed AD directory. * @return Returns a reference to this object so that method calls can be chained together. */ Builder domainName(String domainName); /** *

* The fully qualified distinguished name of the organizational unit within the self-managed AD directory to * which the Windows File Server or ONTAP storage virtual machine (SVM) instance is joined. *

* * @param organizationalUnitDistinguishedName * The fully qualified distinguished name of the organizational unit within the self-managed AD directory * to which the Windows File Server or ONTAP storage virtual machine (SVM) instance is joined. * @return Returns a reference to this object so that method calls can be chained together. */ Builder organizationalUnitDistinguishedName(String organizationalUnitDistinguishedName); /** *

* The name of the domain group whose members have administrative privileges for the FSx file system. *

* * @param fileSystemAdministratorsGroup * The name of the domain group whose members have administrative privileges for the FSx file system. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fileSystemAdministratorsGroup(String fileSystemAdministratorsGroup); /** *

* The user name for the service account on your self-managed AD domain that FSx uses to join to your AD domain. *

* * @param userName * The user name for the service account on your self-managed AD domain that FSx uses to join to your AD * domain. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userName(String userName); /** *

* A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD directory. *

* * @param dnsIps * A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD * directory. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dnsIps(Collection dnsIps); /** *

* A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD directory. *

* * @param dnsIps * A list of up to three IP addresses of DNS servers or domain controllers in the self-managed AD * directory. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dnsIps(String... dnsIps); } static final class BuilderImpl implements Builder { private String domainName; private String organizationalUnitDistinguishedName; private String fileSystemAdministratorsGroup; private String userName; private List dnsIps = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(SelfManagedActiveDirectoryAttributes model) { domainName(model.domainName); organizationalUnitDistinguishedName(model.organizationalUnitDistinguishedName); fileSystemAdministratorsGroup(model.fileSystemAdministratorsGroup); userName(model.userName); dnsIps(model.dnsIps); } public final String getDomainName() { return domainName; } public final void setDomainName(String domainName) { this.domainName = domainName; } @Override public final Builder domainName(String domainName) { this.domainName = domainName; return this; } public final String getOrganizationalUnitDistinguishedName() { return organizationalUnitDistinguishedName; } public final void setOrganizationalUnitDistinguishedName(String organizationalUnitDistinguishedName) { this.organizationalUnitDistinguishedName = organizationalUnitDistinguishedName; } @Override public final Builder organizationalUnitDistinguishedName(String organizationalUnitDistinguishedName) { this.organizationalUnitDistinguishedName = organizationalUnitDistinguishedName; return this; } public final String getFileSystemAdministratorsGroup() { return fileSystemAdministratorsGroup; } public final void setFileSystemAdministratorsGroup(String fileSystemAdministratorsGroup) { this.fileSystemAdministratorsGroup = fileSystemAdministratorsGroup; } @Override public final Builder fileSystemAdministratorsGroup(String fileSystemAdministratorsGroup) { this.fileSystemAdministratorsGroup = fileSystemAdministratorsGroup; return this; } public final String getUserName() { return userName; } public final void setUserName(String userName) { this.userName = userName; } @Override public final Builder userName(String userName) { this.userName = userName; return this; } public final Collection getDnsIps() { if (dnsIps instanceof SdkAutoConstructList) { return null; } return dnsIps; } public final void setDnsIps(Collection dnsIps) { this.dnsIps = DnsIpsCopier.copy(dnsIps); } @Override public final Builder dnsIps(Collection dnsIps) { this.dnsIps = DnsIpsCopier.copy(dnsIps); return this; } @Override @SafeVarargs public final Builder dnsIps(String... dnsIps) { dnsIps(Arrays.asList(dnsIps)); return this; } @Override public SelfManagedActiveDirectoryAttributes build() { return new SelfManagedActiveDirectoryAttributes(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy