001
002package com.commercetools.history.models.common;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.Valid;
010import javax.validation.constraints.NotNull;
011
012import com.fasterxml.jackson.annotation.*;
013import com.fasterxml.jackson.databind.annotation.*;
014
015import io.vrap.rmf.base.client.utils.Generated;
016
017/**
018 * AssociateRoleAssignment
019 *
020 * <hr>
021 * Example to create an instance using the builder pattern
022 * <div class=code-example>
023 * <pre><code class='java'>
024 *     AssociateRoleAssignment associateRoleAssignment = AssociateRoleAssignment.builder()
025 *             .associateRole(associateRoleBuilder -> associateRoleBuilder)
026 *             .inheritance(AssociateRoleInheritanceMode.ENABLED)
027 *             .build()
028 * </code></pre>
029 * </div>
030 */
031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
032@JsonDeserialize(as = AssociateRoleAssignmentImpl.class)
033public interface AssociateRoleAssignment {
034
035    /**
036     *
037     * @return associateRole
038     */
039    @NotNull
040    @Valid
041    @JsonProperty("associateRole")
042    public KeyReference getAssociateRole();
043
044    /**
045     *  <p>Determines whether an AssociateRoleAssignment can be inherited by child Business Units.</p>
046     * @return inheritance
047     */
048    @NotNull
049    @JsonProperty("inheritance")
050    public AssociateRoleInheritanceMode getInheritance();
051
052    /**
053     * set associateRole
054     * @param associateRole value to be set
055     */
056
057    public void setAssociateRole(final KeyReference associateRole);
058
059    /**
060     *  <p>Determines whether an AssociateRoleAssignment can be inherited by child Business Units.</p>
061     * @param inheritance value to be set
062     */
063
064    public void setInheritance(final AssociateRoleInheritanceMode inheritance);
065
066    /**
067     * factory method
068     * @return instance of AssociateRoleAssignment
069     */
070    public static AssociateRoleAssignment of() {
071        return new AssociateRoleAssignmentImpl();
072    }
073
074    /**
075     * factory method to create a shallow copy AssociateRoleAssignment
076     * @param template instance to be copied
077     * @return copy instance
078     */
079    public static AssociateRoleAssignment of(final AssociateRoleAssignment template) {
080        AssociateRoleAssignmentImpl instance = new AssociateRoleAssignmentImpl();
081        instance.setAssociateRole(template.getAssociateRole());
082        instance.setInheritance(template.getInheritance());
083        return instance;
084    }
085
086    /**
087     * factory method to create a deep copy of AssociateRoleAssignment
088     * @param template instance to be copied
089     * @return copy instance
090     */
091    @Nullable
092    public static AssociateRoleAssignment deepCopy(@Nullable final AssociateRoleAssignment template) {
093        if (template == null) {
094            return null;
095        }
096        AssociateRoleAssignmentImpl instance = new AssociateRoleAssignmentImpl();
097        instance.setAssociateRole(
098            com.commercetools.history.models.common.KeyReference.deepCopy(template.getAssociateRole()));
099        instance.setInheritance(template.getInheritance());
100        return instance;
101    }
102
103    /**
104     * builder factory method for AssociateRoleAssignment
105     * @return builder
106     */
107    public static AssociateRoleAssignmentBuilder builder() {
108        return AssociateRoleAssignmentBuilder.of();
109    }
110
111    /**
112     * create builder for AssociateRoleAssignment instance
113     * @param template instance with prefilled values for the builder
114     * @return builder
115     */
116    public static AssociateRoleAssignmentBuilder builder(final AssociateRoleAssignment template) {
117        return AssociateRoleAssignmentBuilder.of(template);
118    }
119
120    /**
121     * accessor map function
122     * @param <T> mapped type
123     * @param helper function to map the object
124     * @return mapped value
125     */
126    default <T> T withAssociateRoleAssignment(Function<AssociateRoleAssignment, T> helper) {
127        return helper.apply(this);
128    }
129
130    /**
131     * gives a TypeReference for usage with Jackson DataBind
132     * @return TypeReference
133     */
134    public static com.fasterxml.jackson.core.type.TypeReference<AssociateRoleAssignment> typeReference() {
135        return new com.fasterxml.jackson.core.type.TypeReference<AssociateRoleAssignment>() {
136            @Override
137            public String toString() {
138                return "TypeReference<AssociateRoleAssignment>";
139            }
140        };
141    }
142}