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

software.amazon.awssdk.services.connect.model.AgentHierarchyGroups Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Connect module holds the client classes that are used for communicating with Connect.

There is a newer version: 2.29.15
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.connect.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;

/**
 * 

* A structure that defines search criteria for contacts using agent hierarchy group levels. For more information about * agent hierarchies, see Set Up * Agent Hierarchies in the Amazon Connect Administrator Guide. *

*/ @Generated("software.amazon.awssdk:codegen") public final class AgentHierarchyGroups implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField> L1_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("L1Ids") .getter(getter(AgentHierarchyGroups::l1Ids)) .setter(setter(Builder::l1Ids)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("L1Ids").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> L2_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("L2Ids") .getter(getter(AgentHierarchyGroups::l2Ids)) .setter(setter(Builder::l2Ids)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("L2Ids").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> L3_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("L3Ids") .getter(getter(AgentHierarchyGroups::l3Ids)) .setter(setter(Builder::l3Ids)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("L3Ids").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> L4_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("L4Ids") .getter(getter(AgentHierarchyGroups::l4Ids)) .setter(setter(Builder::l4Ids)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("L4Ids").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> L5_IDS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("L5Ids") .getter(getter(AgentHierarchyGroups::l5Ids)) .setter(setter(Builder::l5Ids)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("L5Ids").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(L1_IDS_FIELD, L2_IDS_FIELD, L3_IDS_FIELD, L4_IDS_FIELD, L5_IDS_FIELD)); private static final long serialVersionUID = 1L; private final List l1Ids; private final List l2Ids; private final List l3Ids; private final List l4Ids; private final List l5Ids; private AgentHierarchyGroups(BuilderImpl builder) { this.l1Ids = builder.l1Ids; this.l2Ids = builder.l2Ids; this.l3Ids = builder.l3Ids; this.l4Ids = builder.l4Ids; this.l5Ids = builder.l5Ids; } /** * For responses, this returns true if the service returned a value for the L1Ids 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 hasL1Ids() { return l1Ids != null && !(l1Ids instanceof SdkAutoConstructList); } /** *

* The identifiers for level 1 hierarchy groups. *

*

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

* * @return The identifiers for level 1 hierarchy groups. */ public final List l1Ids() { return l1Ids; } /** * For responses, this returns true if the service returned a value for the L2Ids 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 hasL2Ids() { return l2Ids != null && !(l2Ids instanceof SdkAutoConstructList); } /** *

* The identifiers for level 2 hierarchy groups. *

*

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

* * @return The identifiers for level 2 hierarchy groups. */ public final List l2Ids() { return l2Ids; } /** * For responses, this returns true if the service returned a value for the L3Ids 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 hasL3Ids() { return l3Ids != null && !(l3Ids instanceof SdkAutoConstructList); } /** *

* The identifiers for level 3 hierarchy groups. *

*

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

* * @return The identifiers for level 3 hierarchy groups. */ public final List l3Ids() { return l3Ids; } /** * For responses, this returns true if the service returned a value for the L4Ids 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 hasL4Ids() { return l4Ids != null && !(l4Ids instanceof SdkAutoConstructList); } /** *

* The identifiers for level 4 hierarchy groups. *

*

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

* * @return The identifiers for level 4 hierarchy groups. */ public final List l4Ids() { return l4Ids; } /** * For responses, this returns true if the service returned a value for the L5Ids 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 hasL5Ids() { return l5Ids != null && !(l5Ids instanceof SdkAutoConstructList); } /** *

* The identifiers for level 5 hierarchy groups. *

*

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

* * @return The identifiers for level 5 hierarchy groups. */ public final List l5Ids() { return l5Ids; } @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(hasL1Ids() ? l1Ids() : null); hashCode = 31 * hashCode + Objects.hashCode(hasL2Ids() ? l2Ids() : null); hashCode = 31 * hashCode + Objects.hashCode(hasL3Ids() ? l3Ids() : null); hashCode = 31 * hashCode + Objects.hashCode(hasL4Ids() ? l4Ids() : null); hashCode = 31 * hashCode + Objects.hashCode(hasL5Ids() ? l5Ids() : 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 AgentHierarchyGroups)) { return false; } AgentHierarchyGroups other = (AgentHierarchyGroups) obj; return hasL1Ids() == other.hasL1Ids() && Objects.equals(l1Ids(), other.l1Ids()) && hasL2Ids() == other.hasL2Ids() && Objects.equals(l2Ids(), other.l2Ids()) && hasL3Ids() == other.hasL3Ids() && Objects.equals(l3Ids(), other.l3Ids()) && hasL4Ids() == other.hasL4Ids() && Objects.equals(l4Ids(), other.l4Ids()) && hasL5Ids() == other.hasL5Ids() && Objects.equals(l5Ids(), other.l5Ids()); } /** * 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("AgentHierarchyGroups").add("L1Ids", hasL1Ids() ? l1Ids() : null) .add("L2Ids", hasL2Ids() ? l2Ids() : null).add("L3Ids", hasL3Ids() ? l3Ids() : null) .add("L4Ids", hasL4Ids() ? l4Ids() : null).add("L5Ids", hasL5Ids() ? l5Ids() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "L1Ids": return Optional.ofNullable(clazz.cast(l1Ids())); case "L2Ids": return Optional.ofNullable(clazz.cast(l2Ids())); case "L3Ids": return Optional.ofNullable(clazz.cast(l3Ids())); case "L4Ids": return Optional.ofNullable(clazz.cast(l4Ids())); case "L5Ids": return Optional.ofNullable(clazz.cast(l5Ids())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((AgentHierarchyGroups) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The identifiers for level 1 hierarchy groups. *

* * @param l1Ids * The identifiers for level 1 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l1Ids(Collection l1Ids); /** *

* The identifiers for level 1 hierarchy groups. *

* * @param l1Ids * The identifiers for level 1 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l1Ids(String... l1Ids); /** *

* The identifiers for level 2 hierarchy groups. *

* * @param l2Ids * The identifiers for level 2 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l2Ids(Collection l2Ids); /** *

* The identifiers for level 2 hierarchy groups. *

* * @param l2Ids * The identifiers for level 2 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l2Ids(String... l2Ids); /** *

* The identifiers for level 3 hierarchy groups. *

* * @param l3Ids * The identifiers for level 3 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l3Ids(Collection l3Ids); /** *

* The identifiers for level 3 hierarchy groups. *

* * @param l3Ids * The identifiers for level 3 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l3Ids(String... l3Ids); /** *

* The identifiers for level 4 hierarchy groups. *

* * @param l4Ids * The identifiers for level 4 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l4Ids(Collection l4Ids); /** *

* The identifiers for level 4 hierarchy groups. *

* * @param l4Ids * The identifiers for level 4 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l4Ids(String... l4Ids); /** *

* The identifiers for level 5 hierarchy groups. *

* * @param l5Ids * The identifiers for level 5 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l5Ids(Collection l5Ids); /** *

* The identifiers for level 5 hierarchy groups. *

* * @param l5Ids * The identifiers for level 5 hierarchy groups. * @return Returns a reference to this object so that method calls can be chained together. */ Builder l5Ids(String... l5Ids); } static final class BuilderImpl implements Builder { private List l1Ids = DefaultSdkAutoConstructList.getInstance(); private List l2Ids = DefaultSdkAutoConstructList.getInstance(); private List l3Ids = DefaultSdkAutoConstructList.getInstance(); private List l4Ids = DefaultSdkAutoConstructList.getInstance(); private List l5Ids = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(AgentHierarchyGroups model) { l1Ids(model.l1Ids); l2Ids(model.l2Ids); l3Ids(model.l3Ids); l4Ids(model.l4Ids); l5Ids(model.l5Ids); } public final Collection getL1Ids() { if (l1Ids instanceof SdkAutoConstructList) { return null; } return l1Ids; } public final void setL1Ids(Collection l1Ids) { this.l1Ids = HierarchyGroupIdListCopier.copy(l1Ids); } @Override public final Builder l1Ids(Collection l1Ids) { this.l1Ids = HierarchyGroupIdListCopier.copy(l1Ids); return this; } @Override @SafeVarargs public final Builder l1Ids(String... l1Ids) { l1Ids(Arrays.asList(l1Ids)); return this; } public final Collection getL2Ids() { if (l2Ids instanceof SdkAutoConstructList) { return null; } return l2Ids; } public final void setL2Ids(Collection l2Ids) { this.l2Ids = HierarchyGroupIdListCopier.copy(l2Ids); } @Override public final Builder l2Ids(Collection l2Ids) { this.l2Ids = HierarchyGroupIdListCopier.copy(l2Ids); return this; } @Override @SafeVarargs public final Builder l2Ids(String... l2Ids) { l2Ids(Arrays.asList(l2Ids)); return this; } public final Collection getL3Ids() { if (l3Ids instanceof SdkAutoConstructList) { return null; } return l3Ids; } public final void setL3Ids(Collection l3Ids) { this.l3Ids = HierarchyGroupIdListCopier.copy(l3Ids); } @Override public final Builder l3Ids(Collection l3Ids) { this.l3Ids = HierarchyGroupIdListCopier.copy(l3Ids); return this; } @Override @SafeVarargs public final Builder l3Ids(String... l3Ids) { l3Ids(Arrays.asList(l3Ids)); return this; } public final Collection getL4Ids() { if (l4Ids instanceof SdkAutoConstructList) { return null; } return l4Ids; } public final void setL4Ids(Collection l4Ids) { this.l4Ids = HierarchyGroupIdListCopier.copy(l4Ids); } @Override public final Builder l4Ids(Collection l4Ids) { this.l4Ids = HierarchyGroupIdListCopier.copy(l4Ids); return this; } @Override @SafeVarargs public final Builder l4Ids(String... l4Ids) { l4Ids(Arrays.asList(l4Ids)); return this; } public final Collection getL5Ids() { if (l5Ids instanceof SdkAutoConstructList) { return null; } return l5Ids; } public final void setL5Ids(Collection l5Ids) { this.l5Ids = HierarchyGroupIdListCopier.copy(l5Ids); } @Override public final Builder l5Ids(Collection l5Ids) { this.l5Ids = HierarchyGroupIdListCopier.copy(l5Ids); return this; } @Override @SafeVarargs public final Builder l5Ids(String... l5Ids) { l5Ids(Arrays.asList(l5Ids)); return this; } @Override public AgentHierarchyGroups build() { return new AgentHierarchyGroups(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy