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

software.amazon.awssdk.services.workmail.model.AccessControlRule Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon WorkMail module holds the client classes that are used for communicating with Amazon WorkMail Service

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.workmail.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.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;

/**
 * 

* A rule that controls access to an WorkMail organization. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AccessControlRule implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(AccessControlRule::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField EFFECT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Effect") .getter(getter(AccessControlRule::effectAsString)).setter(setter(Builder::effect)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Effect").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(AccessControlRule::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField> IP_RANGES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("IpRanges") .getter(getter(AccessControlRule::ipRanges)) .setter(setter(Builder::ipRanges)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IpRanges").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> NOT_IP_RANGES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotIpRanges") .getter(getter(AccessControlRule::notIpRanges)) .setter(setter(Builder::notIpRanges)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotIpRanges").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> ACTIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Actions") .getter(getter(AccessControlRule::actions)) .setter(setter(Builder::actions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Actions").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> NOT_ACTIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotActions") .getter(getter(AccessControlRule::notActions)) .setter(setter(Builder::notActions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotActions").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> USER_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("UserIds") .getter(getter(AccessControlRule::userIds)) .setter(setter(Builder::userIds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserIds").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> NOT_USER_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotUserIds") .getter(getter(AccessControlRule::notUserIds)) .setter(setter(Builder::notUserIds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotUserIds").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 DATE_CREATED_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("DateCreated").getter(getter(AccessControlRule::dateCreated)).setter(setter(Builder::dateCreated)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateCreated").build()).build(); private static final SdkField DATE_MODIFIED_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("DateModified").getter(getter(AccessControlRule::dateModified)).setter(setter(Builder::dateModified)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateModified").build()).build(); private static final SdkField> IMPERSONATION_ROLE_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("ImpersonationRoleIds") .getter(getter(AccessControlRule::impersonationRoleIds)) .setter(setter(Builder::impersonationRoleIds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImpersonationRoleIds").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> NOT_IMPERSONATION_ROLE_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotImpersonationRoleIds") .getter(getter(AccessControlRule::notImpersonationRoleIds)) .setter(setter(Builder::notImpersonationRoleIds)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotImpersonationRoleIds").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(NAME_FIELD, EFFECT_FIELD, DESCRIPTION_FIELD, IP_RANGES_FIELD, NOT_IP_RANGES_FIELD, ACTIONS_FIELD, NOT_ACTIONS_FIELD, USER_IDS_FIELD, NOT_USER_IDS_FIELD, DATE_CREATED_FIELD, DATE_MODIFIED_FIELD, IMPERSONATION_ROLE_IDS_FIELD, NOT_IMPERSONATION_ROLE_IDS_FIELD)); private static final long serialVersionUID = 1L; private final String name; private final String effect; private final String description; private final List ipRanges; private final List notIpRanges; private final List actions; private final List notActions; private final List userIds; private final List notUserIds; private final Instant dateCreated; private final Instant dateModified; private final List impersonationRoleIds; private final List notImpersonationRoleIds; private AccessControlRule(BuilderImpl builder) { this.name = builder.name; this.effect = builder.effect; this.description = builder.description; this.ipRanges = builder.ipRanges; this.notIpRanges = builder.notIpRanges; this.actions = builder.actions; this.notActions = builder.notActions; this.userIds = builder.userIds; this.notUserIds = builder.notUserIds; this.dateCreated = builder.dateCreated; this.dateModified = builder.dateModified; this.impersonationRoleIds = builder.impersonationRoleIds; this.notImpersonationRoleIds = builder.notImpersonationRoleIds; } /** *

* The rule name. *

* * @return The rule name. */ public final String name() { return name; } /** *

* The rule effect. *

*

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

* * @return The rule effect. * @see AccessControlRuleEffect */ public final AccessControlRuleEffect effect() { return AccessControlRuleEffect.fromValue(effect); } /** *

* The rule effect. *

*

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

* * @return The rule effect. * @see AccessControlRuleEffect */ public final String effectAsString() { return effect; } /** *

* The rule description. *

* * @return The rule description. */ public final String description() { return description; } /** * For responses, this returns true if the service returned a value for the IpRanges 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 hasIpRanges() { return ipRanges != null && !(ipRanges instanceof SdkAutoConstructList); } /** *

* IPv4 CIDR ranges to include in the rule. *

*

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

* * @return IPv4 CIDR ranges to include in the rule. */ public final List ipRanges() { return ipRanges; } /** * For responses, this returns true if the service returned a value for the NotIpRanges 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 hasNotIpRanges() { return notIpRanges != null && !(notIpRanges instanceof SdkAutoConstructList); } /** *

* IPv4 CIDR ranges to exclude from the rule. *

*

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

* * @return IPv4 CIDR ranges to exclude from the rule. */ public final List notIpRanges() { return notIpRanges; } /** * For responses, this returns true if the service returned a value for the Actions 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 hasActions() { return actions != null && !(actions instanceof SdkAutoConstructList); } /** *

* Access protocol actions to include in the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, * and WebMail. *

*

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

* * @return Access protocol actions to include in the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. */ public final List actions() { return actions; } /** * For responses, this returns true if the service returned a value for the NotActions 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 hasNotActions() { return notActions != null && !(notActions instanceof SdkAutoConstructList); } /** *

* Access protocol actions to exclude from the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, * and WebMail. *

*

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

* * @return Access protocol actions to exclude from the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. */ public final List notActions() { return notActions; } /** * For responses, this returns true if the service returned a value for the UserIds 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 hasUserIds() { return userIds != null && !(userIds instanceof SdkAutoConstructList); } /** *

* User IDs to include in the rule. *

*

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

* * @return User IDs to include in the rule. */ public final List userIds() { return userIds; } /** * For responses, this returns true if the service returned a value for the NotUserIds 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 hasNotUserIds() { return notUserIds != null && !(notUserIds instanceof SdkAutoConstructList); } /** *

* User IDs to exclude from the rule. *

*

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

* * @return User IDs to exclude from the rule. */ public final List notUserIds() { return notUserIds; } /** *

* The date that the rule was created. *

* * @return The date that the rule was created. */ public final Instant dateCreated() { return dateCreated; } /** *

* The date that the rule was modified. *

* * @return The date that the rule was modified. */ public final Instant dateModified() { return dateModified; } /** * For responses, this returns true if the service returned a value for the ImpersonationRoleIds 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 hasImpersonationRoleIds() { return impersonationRoleIds != null && !(impersonationRoleIds instanceof SdkAutoConstructList); } /** *

* Impersonation role IDs to include in the rule. *

*

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

* * @return Impersonation role IDs to include in the rule. */ public final List impersonationRoleIds() { return impersonationRoleIds; } /** * For responses, this returns true if the service returned a value for the NotImpersonationRoleIds 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 hasNotImpersonationRoleIds() { return notImpersonationRoleIds != null && !(notImpersonationRoleIds instanceof SdkAutoConstructList); } /** *

* Impersonation role IDs to exclude from the rule. *

*

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

* * @return Impersonation role IDs to exclude from the rule. */ public final List notImpersonationRoleIds() { return notImpersonationRoleIds; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(effectAsString()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(hasIpRanges() ? ipRanges() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotIpRanges() ? notIpRanges() : null); hashCode = 31 * hashCode + Objects.hashCode(hasActions() ? actions() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotActions() ? notActions() : null); hashCode = 31 * hashCode + Objects.hashCode(hasUserIds() ? userIds() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotUserIds() ? notUserIds() : null); hashCode = 31 * hashCode + Objects.hashCode(dateCreated()); hashCode = 31 * hashCode + Objects.hashCode(dateModified()); hashCode = 31 * hashCode + Objects.hashCode(hasImpersonationRoleIds() ? impersonationRoleIds() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotImpersonationRoleIds() ? notImpersonationRoleIds() : 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 AccessControlRule)) { return false; } AccessControlRule other = (AccessControlRule) obj; return Objects.equals(name(), other.name()) && Objects.equals(effectAsString(), other.effectAsString()) && Objects.equals(description(), other.description()) && hasIpRanges() == other.hasIpRanges() && Objects.equals(ipRanges(), other.ipRanges()) && hasNotIpRanges() == other.hasNotIpRanges() && Objects.equals(notIpRanges(), other.notIpRanges()) && hasActions() == other.hasActions() && Objects.equals(actions(), other.actions()) && hasNotActions() == other.hasNotActions() && Objects.equals(notActions(), other.notActions()) && hasUserIds() == other.hasUserIds() && Objects.equals(userIds(), other.userIds()) && hasNotUserIds() == other.hasNotUserIds() && Objects.equals(notUserIds(), other.notUserIds()) && Objects.equals(dateCreated(), other.dateCreated()) && Objects.equals(dateModified(), other.dateModified()) && hasImpersonationRoleIds() == other.hasImpersonationRoleIds() && Objects.equals(impersonationRoleIds(), other.impersonationRoleIds()) && hasNotImpersonationRoleIds() == other.hasNotImpersonationRoleIds() && Objects.equals(notImpersonationRoleIds(), other.notImpersonationRoleIds()); } /** * 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("AccessControlRule").add("Name", name()).add("Effect", effectAsString()) .add("Description", description()).add("IpRanges", hasIpRanges() ? ipRanges() : null) .add("NotIpRanges", hasNotIpRanges() ? notIpRanges() : null).add("Actions", hasActions() ? actions() : null) .add("NotActions", hasNotActions() ? notActions() : null).add("UserIds", hasUserIds() ? userIds() : null) .add("NotUserIds", hasNotUserIds() ? notUserIds() : null).add("DateCreated", dateCreated()) .add("DateModified", dateModified()) .add("ImpersonationRoleIds", hasImpersonationRoleIds() ? impersonationRoleIds() : null) .add("NotImpersonationRoleIds", hasNotImpersonationRoleIds() ? notImpersonationRoleIds() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Name": return Optional.ofNullable(clazz.cast(name())); case "Effect": return Optional.ofNullable(clazz.cast(effectAsString())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "IpRanges": return Optional.ofNullable(clazz.cast(ipRanges())); case "NotIpRanges": return Optional.ofNullable(clazz.cast(notIpRanges())); case "Actions": return Optional.ofNullable(clazz.cast(actions())); case "NotActions": return Optional.ofNullable(clazz.cast(notActions())); case "UserIds": return Optional.ofNullable(clazz.cast(userIds())); case "NotUserIds": return Optional.ofNullable(clazz.cast(notUserIds())); case "DateCreated": return Optional.ofNullable(clazz.cast(dateCreated())); case "DateModified": return Optional.ofNullable(clazz.cast(dateModified())); case "ImpersonationRoleIds": return Optional.ofNullable(clazz.cast(impersonationRoleIds())); case "NotImpersonationRoleIds": return Optional.ofNullable(clazz.cast(notImpersonationRoleIds())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AccessControlRule) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The rule name. *

* * @param name * The rule name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

* The rule effect. *

* * @param effect * The rule effect. * @see AccessControlRuleEffect * @return Returns a reference to this object so that method calls can be chained together. * @see AccessControlRuleEffect */ Builder effect(String effect); /** *

* The rule effect. *

* * @param effect * The rule effect. * @see AccessControlRuleEffect * @return Returns a reference to this object so that method calls can be chained together. * @see AccessControlRuleEffect */ Builder effect(AccessControlRuleEffect effect); /** *

* The rule description. *

* * @param description * The rule description. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* IPv4 CIDR ranges to include in the rule. *

* * @param ipRanges * IPv4 CIDR ranges to include in the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipRanges(Collection ipRanges); /** *

* IPv4 CIDR ranges to include in the rule. *

* * @param ipRanges * IPv4 CIDR ranges to include in the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ipRanges(String... ipRanges); /** *

* IPv4 CIDR ranges to exclude from the rule. *

* * @param notIpRanges * IPv4 CIDR ranges to exclude from the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notIpRanges(Collection notIpRanges); /** *

* IPv4 CIDR ranges to exclude from the rule. *

* * @param notIpRanges * IPv4 CIDR ranges to exclude from the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notIpRanges(String... notIpRanges); /** *

* Access protocol actions to include in the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. *

* * @param actions * Access protocol actions to include in the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(Collection actions); /** *

* Access protocol actions to include in the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. *

* * @param actions * Access protocol actions to include in the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actions(String... actions); /** *

* Access protocol actions to exclude from the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. *

* * @param notActions * Access protocol actions to exclude from the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notActions(Collection notActions); /** *

* Access protocol actions to exclude from the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. *

* * @param notActions * Access protocol actions to exclude from the rule. Valid values include ActiveSync, * AutoDiscover, EWS, IMAP, SMTP, * WindowsOutlook, and WebMail. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notActions(String... notActions); /** *

* User IDs to include in the rule. *

* * @param userIds * User IDs to include in the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userIds(Collection userIds); /** *

* User IDs to include in the rule. *

* * @param userIds * User IDs to include in the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userIds(String... userIds); /** *

* User IDs to exclude from the rule. *

* * @param notUserIds * User IDs to exclude from the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notUserIds(Collection notUserIds); /** *

* User IDs to exclude from the rule. *

* * @param notUserIds * User IDs to exclude from the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notUserIds(String... notUserIds); /** *

* The date that the rule was created. *

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

* The date that the rule was modified. *

* * @param dateModified * The date that the rule was modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dateModified(Instant dateModified); /** *

* Impersonation role IDs to include in the rule. *

* * @param impersonationRoleIds * Impersonation role IDs to include in the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder impersonationRoleIds(Collection impersonationRoleIds); /** *

* Impersonation role IDs to include in the rule. *

* * @param impersonationRoleIds * Impersonation role IDs to include in the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder impersonationRoleIds(String... impersonationRoleIds); /** *

* Impersonation role IDs to exclude from the rule. *

* * @param notImpersonationRoleIds * Impersonation role IDs to exclude from the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notImpersonationRoleIds(Collection notImpersonationRoleIds); /** *

* Impersonation role IDs to exclude from the rule. *

* * @param notImpersonationRoleIds * Impersonation role IDs to exclude from the rule. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notImpersonationRoleIds(String... notImpersonationRoleIds); } static final class BuilderImpl implements Builder { private String name; private String effect; private String description; private List ipRanges = DefaultSdkAutoConstructList.getInstance(); private List notIpRanges = DefaultSdkAutoConstructList.getInstance(); private List actions = DefaultSdkAutoConstructList.getInstance(); private List notActions = DefaultSdkAutoConstructList.getInstance(); private List userIds = DefaultSdkAutoConstructList.getInstance(); private List notUserIds = DefaultSdkAutoConstructList.getInstance(); private Instant dateCreated; private Instant dateModified; private List impersonationRoleIds = DefaultSdkAutoConstructList.getInstance(); private List notImpersonationRoleIds = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(AccessControlRule model) { name(model.name); effect(model.effect); description(model.description); ipRanges(model.ipRanges); notIpRanges(model.notIpRanges); actions(model.actions); notActions(model.notActions); userIds(model.userIds); notUserIds(model.notUserIds); dateCreated(model.dateCreated); dateModified(model.dateModified); impersonationRoleIds(model.impersonationRoleIds); notImpersonationRoleIds(model.notImpersonationRoleIds); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getEffect() { return effect; } public final void setEffect(String effect) { this.effect = effect; } @Override public final Builder effect(String effect) { this.effect = effect; return this; } @Override public final Builder effect(AccessControlRuleEffect effect) { this.effect(effect == null ? null : effect.toString()); return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final Collection getIpRanges() { if (ipRanges instanceof SdkAutoConstructList) { return null; } return ipRanges; } public final void setIpRanges(Collection ipRanges) { this.ipRanges = IpRangeListCopier.copy(ipRanges); } @Override public final Builder ipRanges(Collection ipRanges) { this.ipRanges = IpRangeListCopier.copy(ipRanges); return this; } @Override @SafeVarargs public final Builder ipRanges(String... ipRanges) { ipRanges(Arrays.asList(ipRanges)); return this; } public final Collection getNotIpRanges() { if (notIpRanges instanceof SdkAutoConstructList) { return null; } return notIpRanges; } public final void setNotIpRanges(Collection notIpRanges) { this.notIpRanges = IpRangeListCopier.copy(notIpRanges); } @Override public final Builder notIpRanges(Collection notIpRanges) { this.notIpRanges = IpRangeListCopier.copy(notIpRanges); return this; } @Override @SafeVarargs public final Builder notIpRanges(String... notIpRanges) { notIpRanges(Arrays.asList(notIpRanges)); return this; } public final Collection getActions() { if (actions instanceof SdkAutoConstructList) { return null; } return actions; } public final void setActions(Collection actions) { this.actions = ActionsListCopier.copy(actions); } @Override public final Builder actions(Collection actions) { this.actions = ActionsListCopier.copy(actions); return this; } @Override @SafeVarargs public final Builder actions(String... actions) { actions(Arrays.asList(actions)); return this; } public final Collection getNotActions() { if (notActions instanceof SdkAutoConstructList) { return null; } return notActions; } public final void setNotActions(Collection notActions) { this.notActions = ActionsListCopier.copy(notActions); } @Override public final Builder notActions(Collection notActions) { this.notActions = ActionsListCopier.copy(notActions); return this; } @Override @SafeVarargs public final Builder notActions(String... notActions) { notActions(Arrays.asList(notActions)); return this; } public final Collection getUserIds() { if (userIds instanceof SdkAutoConstructList) { return null; } return userIds; } public final void setUserIds(Collection userIds) { this.userIds = UserIdListCopier.copy(userIds); } @Override public final Builder userIds(Collection userIds) { this.userIds = UserIdListCopier.copy(userIds); return this; } @Override @SafeVarargs public final Builder userIds(String... userIds) { userIds(Arrays.asList(userIds)); return this; } public final Collection getNotUserIds() { if (notUserIds instanceof SdkAutoConstructList) { return null; } return notUserIds; } public final void setNotUserIds(Collection notUserIds) { this.notUserIds = UserIdListCopier.copy(notUserIds); } @Override public final Builder notUserIds(Collection notUserIds) { this.notUserIds = UserIdListCopier.copy(notUserIds); return this; } @Override @SafeVarargs public final Builder notUserIds(String... notUserIds) { notUserIds(Arrays.asList(notUserIds)); return this; } public final Instant getDateCreated() { return dateCreated; } public final void setDateCreated(Instant dateCreated) { this.dateCreated = dateCreated; } @Override public final Builder dateCreated(Instant dateCreated) { this.dateCreated = dateCreated; return this; } public final Instant getDateModified() { return dateModified; } public final void setDateModified(Instant dateModified) { this.dateModified = dateModified; } @Override public final Builder dateModified(Instant dateModified) { this.dateModified = dateModified; return this; } public final Collection getImpersonationRoleIds() { if (impersonationRoleIds instanceof SdkAutoConstructList) { return null; } return impersonationRoleIds; } public final void setImpersonationRoleIds(Collection impersonationRoleIds) { this.impersonationRoleIds = ImpersonationRoleIdListCopier.copy(impersonationRoleIds); } @Override public final Builder impersonationRoleIds(Collection impersonationRoleIds) { this.impersonationRoleIds = ImpersonationRoleIdListCopier.copy(impersonationRoleIds); return this; } @Override @SafeVarargs public final Builder impersonationRoleIds(String... impersonationRoleIds) { impersonationRoleIds(Arrays.asList(impersonationRoleIds)); return this; } public final Collection getNotImpersonationRoleIds() { if (notImpersonationRoleIds instanceof SdkAutoConstructList) { return null; } return notImpersonationRoleIds; } public final void setNotImpersonationRoleIds(Collection notImpersonationRoleIds) { this.notImpersonationRoleIds = ImpersonationRoleIdListCopier.copy(notImpersonationRoleIds); } @Override public final Builder notImpersonationRoleIds(Collection notImpersonationRoleIds) { this.notImpersonationRoleIds = ImpersonationRoleIdListCopier.copy(notImpersonationRoleIds); return this; } @Override @SafeVarargs public final Builder notImpersonationRoleIds(String... notImpersonationRoleIds) { notImpersonationRoleIds(Arrays.asList(notImpersonationRoleIds)); return this; } @Override public AccessControlRule build() { return new AccessControlRule(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy