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

software.amazon.awssdk.services.workmail.model.MobileDeviceAccessRule 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 mobile devices for an WorkMail group. *

*/ @Generated("software.amazon.awssdk:codegen") public final class MobileDeviceAccessRule implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField MOBILE_DEVICE_ACCESS_RULE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("MobileDeviceAccessRuleId").getter(getter(MobileDeviceAccessRule::mobileDeviceAccessRuleId)) .setter(setter(Builder::mobileDeviceAccessRuleId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MobileDeviceAccessRuleId").build()) .build(); private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name") .getter(getter(MobileDeviceAccessRule::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Description").getter(getter(MobileDeviceAccessRule::description)).setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build(); private static final SdkField EFFECT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Effect") .getter(getter(MobileDeviceAccessRule::effectAsString)).setter(setter(Builder::effect)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Effect").build()).build(); private static final SdkField> DEVICE_TYPES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DeviceTypes") .getter(getter(MobileDeviceAccessRule::deviceTypes)) .setter(setter(Builder::deviceTypes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceTypes").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_DEVICE_TYPES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotDeviceTypes") .getter(getter(MobileDeviceAccessRule::notDeviceTypes)) .setter(setter(Builder::notDeviceTypes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotDeviceTypes").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> DEVICE_MODELS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DeviceModels") .getter(getter(MobileDeviceAccessRule::deviceModels)) .setter(setter(Builder::deviceModels)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceModels").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_DEVICE_MODELS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotDeviceModels") .getter(getter(MobileDeviceAccessRule::notDeviceModels)) .setter(setter(Builder::notDeviceModels)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotDeviceModels").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> DEVICE_OPERATING_SYSTEMS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DeviceOperatingSystems") .getter(getter(MobileDeviceAccessRule::deviceOperatingSystems)) .setter(setter(Builder::deviceOperatingSystems)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceOperatingSystems").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_DEVICE_OPERATING_SYSTEMS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotDeviceOperatingSystems") .getter(getter(MobileDeviceAccessRule::notDeviceOperatingSystems)) .setter(setter(Builder::notDeviceOperatingSystems)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotDeviceOperatingSystems").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> DEVICE_USER_AGENTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("DeviceUserAgents") .getter(getter(MobileDeviceAccessRule::deviceUserAgents)) .setter(setter(Builder::deviceUserAgents)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeviceUserAgents").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_DEVICE_USER_AGENTS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("NotDeviceUserAgents") .getter(getter(MobileDeviceAccessRule::notDeviceUserAgents)) .setter(setter(Builder::notDeviceUserAgents)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotDeviceUserAgents").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(MobileDeviceAccessRule::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(MobileDeviceAccessRule::dateModified)) .setter(setter(Builder::dateModified)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateModified").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( MOBILE_DEVICE_ACCESS_RULE_ID_FIELD, NAME_FIELD, DESCRIPTION_FIELD, EFFECT_FIELD, DEVICE_TYPES_FIELD, NOT_DEVICE_TYPES_FIELD, DEVICE_MODELS_FIELD, NOT_DEVICE_MODELS_FIELD, DEVICE_OPERATING_SYSTEMS_FIELD, NOT_DEVICE_OPERATING_SYSTEMS_FIELD, DEVICE_USER_AGENTS_FIELD, NOT_DEVICE_USER_AGENTS_FIELD, DATE_CREATED_FIELD, DATE_MODIFIED_FIELD)); private static final long serialVersionUID = 1L; private final String mobileDeviceAccessRuleId; private final String name; private final String description; private final String effect; private final List deviceTypes; private final List notDeviceTypes; private final List deviceModels; private final List notDeviceModels; private final List deviceOperatingSystems; private final List notDeviceOperatingSystems; private final List deviceUserAgents; private final List notDeviceUserAgents; private final Instant dateCreated; private final Instant dateModified; private MobileDeviceAccessRule(BuilderImpl builder) { this.mobileDeviceAccessRuleId = builder.mobileDeviceAccessRuleId; this.name = builder.name; this.description = builder.description; this.effect = builder.effect; this.deviceTypes = builder.deviceTypes; this.notDeviceTypes = builder.notDeviceTypes; this.deviceModels = builder.deviceModels; this.notDeviceModels = builder.notDeviceModels; this.deviceOperatingSystems = builder.deviceOperatingSystems; this.notDeviceOperatingSystems = builder.notDeviceOperatingSystems; this.deviceUserAgents = builder.deviceUserAgents; this.notDeviceUserAgents = builder.notDeviceUserAgents; this.dateCreated = builder.dateCreated; this.dateModified = builder.dateModified; } /** *

* The ID assigned to a mobile access rule. *

* * @return The ID assigned to a mobile access rule. */ public final String mobileDeviceAccessRuleId() { return mobileDeviceAccessRuleId; } /** *

* The name of a mobile access rule. *

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

* The description of a mobile access rule. *

* * @return The description of a mobile access rule. */ public final String description() { return description; } /** *

* The effect of the rule when it matches. Allowed values are ALLOW or DENY. *

*

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

* * @return The effect of the rule when it matches. Allowed values are ALLOW or DENY. * @see MobileDeviceAccessRuleEffect */ public final MobileDeviceAccessRuleEffect effect() { return MobileDeviceAccessRuleEffect.fromValue(effect); } /** *

* The effect of the rule when it matches. Allowed values are ALLOW or DENY. *

*

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

* * @return The effect of the rule when it matches. Allowed values are ALLOW or DENY. * @see MobileDeviceAccessRuleEffect */ public final String effectAsString() { return effect; } /** * For responses, this returns true if the service returned a value for the DeviceTypes 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 hasDeviceTypes() { return deviceTypes != null && !(deviceTypes instanceof SdkAutoConstructList); } /** *

* Device types that a rule will match. *

*

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

* * @return Device types that a rule will match. */ public final List deviceTypes() { return deviceTypes; } /** * For responses, this returns true if the service returned a value for the NotDeviceTypes 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 hasNotDeviceTypes() { return notDeviceTypes != null && !(notDeviceTypes instanceof SdkAutoConstructList); } /** *

* Device types that a rule will not match. All other device types will match. *

*

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

* * @return Device types that a rule will not match. All other device types will match. */ public final List notDeviceTypes() { return notDeviceTypes; } /** * For responses, this returns true if the service returned a value for the DeviceModels 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 hasDeviceModels() { return deviceModels != null && !(deviceModels instanceof SdkAutoConstructList); } /** *

* Device models that a rule will match. *

*

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

* * @return Device models that a rule will match. */ public final List deviceModels() { return deviceModels; } /** * For responses, this returns true if the service returned a value for the NotDeviceModels 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 hasNotDeviceModels() { return notDeviceModels != null && !(notDeviceModels instanceof SdkAutoConstructList); } /** *

* Device models that a rule will not match. All other device models will match. *

*

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

* * @return Device models that a rule will not match. All other device models will match. */ public final List notDeviceModels() { return notDeviceModels; } /** * For responses, this returns true if the service returned a value for the DeviceOperatingSystems 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 hasDeviceOperatingSystems() { return deviceOperatingSystems != null && !(deviceOperatingSystems instanceof SdkAutoConstructList); } /** *

* Device operating systems that a rule will match. *

*

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

* * @return Device operating systems that a rule will match. */ public final List deviceOperatingSystems() { return deviceOperatingSystems; } /** * For responses, this returns true if the service returned a value for the NotDeviceOperatingSystems 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 hasNotDeviceOperatingSystems() { return notDeviceOperatingSystems != null && !(notDeviceOperatingSystems instanceof SdkAutoConstructList); } /** *

* Device operating systems that a rule will not match. All other device types will match. *

*

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

* * @return Device operating systems that a rule will not match. All other device types will match. */ public final List notDeviceOperatingSystems() { return notDeviceOperatingSystems; } /** * For responses, this returns true if the service returned a value for the DeviceUserAgents 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 hasDeviceUserAgents() { return deviceUserAgents != null && !(deviceUserAgents instanceof SdkAutoConstructList); } /** *

* Device user agents that a rule will match. *

*

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

* * @return Device user agents that a rule will match. */ public final List deviceUserAgents() { return deviceUserAgents; } /** * For responses, this returns true if the service returned a value for the NotDeviceUserAgents 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 hasNotDeviceUserAgents() { return notDeviceUserAgents != null && !(notDeviceUserAgents instanceof SdkAutoConstructList); } /** *

* Device user agents that a rule will not match. All other device user agents will match. *

*

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

* * @return Device user agents that a rule will not match. All other device user agents will match. */ public final List notDeviceUserAgents() { return notDeviceUserAgents; } /** *

* The date and time at which an access rule was created. *

* * @return The date and time at which an access rule was created. */ public final Instant dateCreated() { return dateCreated; } /** *

* The date and time at which an access rule was modified. *

* * @return The date and time at which an access rule was modified. */ public final Instant dateModified() { return dateModified; } @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(mobileDeviceAccessRuleId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(effectAsString()); hashCode = 31 * hashCode + Objects.hashCode(hasDeviceTypes() ? deviceTypes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotDeviceTypes() ? notDeviceTypes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasDeviceModels() ? deviceModels() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotDeviceModels() ? notDeviceModels() : null); hashCode = 31 * hashCode + Objects.hashCode(hasDeviceOperatingSystems() ? deviceOperatingSystems() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotDeviceOperatingSystems() ? notDeviceOperatingSystems() : null); hashCode = 31 * hashCode + Objects.hashCode(hasDeviceUserAgents() ? deviceUserAgents() : null); hashCode = 31 * hashCode + Objects.hashCode(hasNotDeviceUserAgents() ? notDeviceUserAgents() : null); hashCode = 31 * hashCode + Objects.hashCode(dateCreated()); hashCode = 31 * hashCode + Objects.hashCode(dateModified()); 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 MobileDeviceAccessRule)) { return false; } MobileDeviceAccessRule other = (MobileDeviceAccessRule) obj; return Objects.equals(mobileDeviceAccessRuleId(), other.mobileDeviceAccessRuleId()) && Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(effectAsString(), other.effectAsString()) && hasDeviceTypes() == other.hasDeviceTypes() && Objects.equals(deviceTypes(), other.deviceTypes()) && hasNotDeviceTypes() == other.hasNotDeviceTypes() && Objects.equals(notDeviceTypes(), other.notDeviceTypes()) && hasDeviceModels() == other.hasDeviceModels() && Objects.equals(deviceModels(), other.deviceModels()) && hasNotDeviceModels() == other.hasNotDeviceModels() && Objects.equals(notDeviceModels(), other.notDeviceModels()) && hasDeviceOperatingSystems() == other.hasDeviceOperatingSystems() && Objects.equals(deviceOperatingSystems(), other.deviceOperatingSystems()) && hasNotDeviceOperatingSystems() == other.hasNotDeviceOperatingSystems() && Objects.equals(notDeviceOperatingSystems(), other.notDeviceOperatingSystems()) && hasDeviceUserAgents() == other.hasDeviceUserAgents() && Objects.equals(deviceUserAgents(), other.deviceUserAgents()) && hasNotDeviceUserAgents() == other.hasNotDeviceUserAgents() && Objects.equals(notDeviceUserAgents(), other.notDeviceUserAgents()) && Objects.equals(dateCreated(), other.dateCreated()) && Objects.equals(dateModified(), other.dateModified()); } /** * 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("MobileDeviceAccessRule").add("MobileDeviceAccessRuleId", mobileDeviceAccessRuleId()) .add("Name", name()).add("Description", description()).add("Effect", effectAsString()) .add("DeviceTypes", hasDeviceTypes() ? deviceTypes() : null) .add("NotDeviceTypes", hasNotDeviceTypes() ? notDeviceTypes() : null) .add("DeviceModels", hasDeviceModels() ? deviceModels() : null) .add("NotDeviceModels", hasNotDeviceModels() ? notDeviceModels() : null) .add("DeviceOperatingSystems", hasDeviceOperatingSystems() ? deviceOperatingSystems() : null) .add("NotDeviceOperatingSystems", hasNotDeviceOperatingSystems() ? notDeviceOperatingSystems() : null) .add("DeviceUserAgents", hasDeviceUserAgents() ? deviceUserAgents() : null) .add("NotDeviceUserAgents", hasNotDeviceUserAgents() ? notDeviceUserAgents() : null) .add("DateCreated", dateCreated()).add("DateModified", dateModified()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "MobileDeviceAccessRuleId": return Optional.ofNullable(clazz.cast(mobileDeviceAccessRuleId())); case "Name": return Optional.ofNullable(clazz.cast(name())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Effect": return Optional.ofNullable(clazz.cast(effectAsString())); case "DeviceTypes": return Optional.ofNullable(clazz.cast(deviceTypes())); case "NotDeviceTypes": return Optional.ofNullable(clazz.cast(notDeviceTypes())); case "DeviceModels": return Optional.ofNullable(clazz.cast(deviceModels())); case "NotDeviceModels": return Optional.ofNullable(clazz.cast(notDeviceModels())); case "DeviceOperatingSystems": return Optional.ofNullable(clazz.cast(deviceOperatingSystems())); case "NotDeviceOperatingSystems": return Optional.ofNullable(clazz.cast(notDeviceOperatingSystems())); case "DeviceUserAgents": return Optional.ofNullable(clazz.cast(deviceUserAgents())); case "NotDeviceUserAgents": return Optional.ofNullable(clazz.cast(notDeviceUserAgents())); case "DateCreated": return Optional.ofNullable(clazz.cast(dateCreated())); case "DateModified": return Optional.ofNullable(clazz.cast(dateModified())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((MobileDeviceAccessRule) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID assigned to a mobile access rule. *

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

* The name of a mobile access rule. *

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

* The description of a mobile access rule. *

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

* The effect of the rule when it matches. Allowed values are ALLOW or DENY. *

* * @param effect * The effect of the rule when it matches. Allowed values are ALLOW or DENY. * @see MobileDeviceAccessRuleEffect * @return Returns a reference to this object so that method calls can be chained together. * @see MobileDeviceAccessRuleEffect */ Builder effect(String effect); /** *

* The effect of the rule when it matches. Allowed values are ALLOW or DENY. *

* * @param effect * The effect of the rule when it matches. Allowed values are ALLOW or DENY. * @see MobileDeviceAccessRuleEffect * @return Returns a reference to this object so that method calls can be chained together. * @see MobileDeviceAccessRuleEffect */ Builder effect(MobileDeviceAccessRuleEffect effect); /** *

* Device types that a rule will match. *

* * @param deviceTypes * Device types that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceTypes(Collection deviceTypes); /** *

* Device types that a rule will match. *

* * @param deviceTypes * Device types that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceTypes(String... deviceTypes); /** *

* Device types that a rule will not match. All other device types will match. *

* * @param notDeviceTypes * Device types that a rule will not match. All other device types will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceTypes(Collection notDeviceTypes); /** *

* Device types that a rule will not match. All other device types will match. *

* * @param notDeviceTypes * Device types that a rule will not match. All other device types will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceTypes(String... notDeviceTypes); /** *

* Device models that a rule will match. *

* * @param deviceModels * Device models that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceModels(Collection deviceModels); /** *

* Device models that a rule will match. *

* * @param deviceModels * Device models that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceModels(String... deviceModels); /** *

* Device models that a rule will not match. All other device models will match. *

* * @param notDeviceModels * Device models that a rule will not match. All other device models will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceModels(Collection notDeviceModels); /** *

* Device models that a rule will not match. All other device models will match. *

* * @param notDeviceModels * Device models that a rule will not match. All other device models will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceModels(String... notDeviceModels); /** *

* Device operating systems that a rule will match. *

* * @param deviceOperatingSystems * Device operating systems that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceOperatingSystems(Collection deviceOperatingSystems); /** *

* Device operating systems that a rule will match. *

* * @param deviceOperatingSystems * Device operating systems that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceOperatingSystems(String... deviceOperatingSystems); /** *

* Device operating systems that a rule will not match. All other device types will match. *

* * @param notDeviceOperatingSystems * Device operating systems that a rule will not match. All other device types will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceOperatingSystems(Collection notDeviceOperatingSystems); /** *

* Device operating systems that a rule will not match. All other device types will match. *

* * @param notDeviceOperatingSystems * Device operating systems that a rule will not match. All other device types will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceOperatingSystems(String... notDeviceOperatingSystems); /** *

* Device user agents that a rule will match. *

* * @param deviceUserAgents * Device user agents that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceUserAgents(Collection deviceUserAgents); /** *

* Device user agents that a rule will match. *

* * @param deviceUserAgents * Device user agents that a rule will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deviceUserAgents(String... deviceUserAgents); /** *

* Device user agents that a rule will not match. All other device user agents will match. *

* * @param notDeviceUserAgents * Device user agents that a rule will not match. All other device user agents will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceUserAgents(Collection notDeviceUserAgents); /** *

* Device user agents that a rule will not match. All other device user agents will match. *

* * @param notDeviceUserAgents * Device user agents that a rule will not match. All other device user agents will match. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notDeviceUserAgents(String... notDeviceUserAgents); /** *

* The date and time at which an access rule was created. *

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

* The date and time at which an access rule was modified. *

* * @param dateModified * The date and time at which an access rule was modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dateModified(Instant dateModified); } static final class BuilderImpl implements Builder { private String mobileDeviceAccessRuleId; private String name; private String description; private String effect; private List deviceTypes = DefaultSdkAutoConstructList.getInstance(); private List notDeviceTypes = DefaultSdkAutoConstructList.getInstance(); private List deviceModels = DefaultSdkAutoConstructList.getInstance(); private List notDeviceModels = DefaultSdkAutoConstructList.getInstance(); private List deviceOperatingSystems = DefaultSdkAutoConstructList.getInstance(); private List notDeviceOperatingSystems = DefaultSdkAutoConstructList.getInstance(); private List deviceUserAgents = DefaultSdkAutoConstructList.getInstance(); private List notDeviceUserAgents = DefaultSdkAutoConstructList.getInstance(); private Instant dateCreated; private Instant dateModified; private BuilderImpl() { } private BuilderImpl(MobileDeviceAccessRule model) { mobileDeviceAccessRuleId(model.mobileDeviceAccessRuleId); name(model.name); description(model.description); effect(model.effect); deviceTypes(model.deviceTypes); notDeviceTypes(model.notDeviceTypes); deviceModels(model.deviceModels); notDeviceModels(model.notDeviceModels); deviceOperatingSystems(model.deviceOperatingSystems); notDeviceOperatingSystems(model.notDeviceOperatingSystems); deviceUserAgents(model.deviceUserAgents); notDeviceUserAgents(model.notDeviceUserAgents); dateCreated(model.dateCreated); dateModified(model.dateModified); } public final String getMobileDeviceAccessRuleId() { return mobileDeviceAccessRuleId; } public final void setMobileDeviceAccessRuleId(String mobileDeviceAccessRuleId) { this.mobileDeviceAccessRuleId = mobileDeviceAccessRuleId; } @Override public final Builder mobileDeviceAccessRuleId(String mobileDeviceAccessRuleId) { this.mobileDeviceAccessRuleId = mobileDeviceAccessRuleId; return this; } 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 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 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(MobileDeviceAccessRuleEffect effect) { this.effect(effect == null ? null : effect.toString()); return this; } public final Collection getDeviceTypes() { if (deviceTypes instanceof SdkAutoConstructList) { return null; } return deviceTypes; } public final void setDeviceTypes(Collection deviceTypes) { this.deviceTypes = DeviceTypeListCopier.copy(deviceTypes); } @Override public final Builder deviceTypes(Collection deviceTypes) { this.deviceTypes = DeviceTypeListCopier.copy(deviceTypes); return this; } @Override @SafeVarargs public final Builder deviceTypes(String... deviceTypes) { deviceTypes(Arrays.asList(deviceTypes)); return this; } public final Collection getNotDeviceTypes() { if (notDeviceTypes instanceof SdkAutoConstructList) { return null; } return notDeviceTypes; } public final void setNotDeviceTypes(Collection notDeviceTypes) { this.notDeviceTypes = DeviceTypeListCopier.copy(notDeviceTypes); } @Override public final Builder notDeviceTypes(Collection notDeviceTypes) { this.notDeviceTypes = DeviceTypeListCopier.copy(notDeviceTypes); return this; } @Override @SafeVarargs public final Builder notDeviceTypes(String... notDeviceTypes) { notDeviceTypes(Arrays.asList(notDeviceTypes)); return this; } public final Collection getDeviceModels() { if (deviceModels instanceof SdkAutoConstructList) { return null; } return deviceModels; } public final void setDeviceModels(Collection deviceModels) { this.deviceModels = DeviceModelListCopier.copy(deviceModels); } @Override public final Builder deviceModels(Collection deviceModels) { this.deviceModels = DeviceModelListCopier.copy(deviceModels); return this; } @Override @SafeVarargs public final Builder deviceModels(String... deviceModels) { deviceModels(Arrays.asList(deviceModels)); return this; } public final Collection getNotDeviceModels() { if (notDeviceModels instanceof SdkAutoConstructList) { return null; } return notDeviceModels; } public final void setNotDeviceModels(Collection notDeviceModels) { this.notDeviceModels = DeviceModelListCopier.copy(notDeviceModels); } @Override public final Builder notDeviceModels(Collection notDeviceModels) { this.notDeviceModels = DeviceModelListCopier.copy(notDeviceModels); return this; } @Override @SafeVarargs public final Builder notDeviceModels(String... notDeviceModels) { notDeviceModels(Arrays.asList(notDeviceModels)); return this; } public final Collection getDeviceOperatingSystems() { if (deviceOperatingSystems instanceof SdkAutoConstructList) { return null; } return deviceOperatingSystems; } public final void setDeviceOperatingSystems(Collection deviceOperatingSystems) { this.deviceOperatingSystems = DeviceOperatingSystemListCopier.copy(deviceOperatingSystems); } @Override public final Builder deviceOperatingSystems(Collection deviceOperatingSystems) { this.deviceOperatingSystems = DeviceOperatingSystemListCopier.copy(deviceOperatingSystems); return this; } @Override @SafeVarargs public final Builder deviceOperatingSystems(String... deviceOperatingSystems) { deviceOperatingSystems(Arrays.asList(deviceOperatingSystems)); return this; } public final Collection getNotDeviceOperatingSystems() { if (notDeviceOperatingSystems instanceof SdkAutoConstructList) { return null; } return notDeviceOperatingSystems; } public final void setNotDeviceOperatingSystems(Collection notDeviceOperatingSystems) { this.notDeviceOperatingSystems = DeviceOperatingSystemListCopier.copy(notDeviceOperatingSystems); } @Override public final Builder notDeviceOperatingSystems(Collection notDeviceOperatingSystems) { this.notDeviceOperatingSystems = DeviceOperatingSystemListCopier.copy(notDeviceOperatingSystems); return this; } @Override @SafeVarargs public final Builder notDeviceOperatingSystems(String... notDeviceOperatingSystems) { notDeviceOperatingSystems(Arrays.asList(notDeviceOperatingSystems)); return this; } public final Collection getDeviceUserAgents() { if (deviceUserAgents instanceof SdkAutoConstructList) { return null; } return deviceUserAgents; } public final void setDeviceUserAgents(Collection deviceUserAgents) { this.deviceUserAgents = DeviceUserAgentListCopier.copy(deviceUserAgents); } @Override public final Builder deviceUserAgents(Collection deviceUserAgents) { this.deviceUserAgents = DeviceUserAgentListCopier.copy(deviceUserAgents); return this; } @Override @SafeVarargs public final Builder deviceUserAgents(String... deviceUserAgents) { deviceUserAgents(Arrays.asList(deviceUserAgents)); return this; } public final Collection getNotDeviceUserAgents() { if (notDeviceUserAgents instanceof SdkAutoConstructList) { return null; } return notDeviceUserAgents; } public final void setNotDeviceUserAgents(Collection notDeviceUserAgents) { this.notDeviceUserAgents = DeviceUserAgentListCopier.copy(notDeviceUserAgents); } @Override public final Builder notDeviceUserAgents(Collection notDeviceUserAgents) { this.notDeviceUserAgents = DeviceUserAgentListCopier.copy(notDeviceUserAgents); return this; } @Override @SafeVarargs public final Builder notDeviceUserAgents(String... notDeviceUserAgents) { notDeviceUserAgents(Arrays.asList(notDeviceUserAgents)); 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; } @Override public MobileDeviceAccessRule build() { return new MobileDeviceAccessRule(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy