001
002package com.commercetools.api.models.associate_role;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 * AssociateRole
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class AssociateRoleImpl implements AssociateRole, ModelBase {
022
023    private String id;
024
025    private Long version;
026
027    private java.time.ZonedDateTime createdAt;
028
029    private java.time.ZonedDateTime lastModifiedAt;
030
031    private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy;
032
033    private com.commercetools.api.models.common.CreatedBy createdBy;
034
035    private String key;
036
037    private Boolean buyerAssignable;
038
039    private String name;
040
041    private java.util.List<com.commercetools.api.models.associate_role.Permission> permissions;
042
043    private com.commercetools.api.models.type.CustomFields custom;
044
045    /**
046     * create instance with all properties
047     */
048    @JsonCreator
049    AssociateRoleImpl(@JsonProperty("id") final String id, @JsonProperty("version") final Long version,
050            @JsonProperty("createdAt") final java.time.ZonedDateTime createdAt,
051            @JsonProperty("lastModifiedAt") final java.time.ZonedDateTime lastModifiedAt,
052            @JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,
053            @JsonProperty("createdBy") final com.commercetools.api.models.common.CreatedBy createdBy,
054            @JsonProperty("key") final String key, @JsonProperty("buyerAssignable") final Boolean buyerAssignable,
055            @JsonProperty("name") final String name,
056            @JsonProperty("permissions") final java.util.List<com.commercetools.api.models.associate_role.Permission> permissions,
057            @JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom) {
058        this.id = id;
059        this.version = version;
060        this.createdAt = createdAt;
061        this.lastModifiedAt = lastModifiedAt;
062        this.lastModifiedBy = lastModifiedBy;
063        this.createdBy = createdBy;
064        this.key = key;
065        this.buyerAssignable = buyerAssignable;
066        this.name = name;
067        this.permissions = permissions;
068        this.custom = custom;
069    }
070
071    /**
072     * create empty instance
073     */
074    public AssociateRoleImpl() {
075    }
076
077    /**
078     *  <p>Unique identifier of the AssociateRole.</p>
079     */
080
081    public String getId() {
082        return this.id;
083    }
084
085    /**
086     *  <p>Current version of the AssociateRole.</p>
087     */
088
089    public Long getVersion() {
090        return this.version;
091    }
092
093    /**
094     *  <p>Date and time (UTC) the AssociateRole was initially created.</p>
095     */
096
097    public java.time.ZonedDateTime getCreatedAt() {
098        return this.createdAt;
099    }
100
101    /**
102     *  <p>Date and time (UTC) the AssociateRole was last updated.</p>
103     */
104
105    public java.time.ZonedDateTime getLastModifiedAt() {
106        return this.lastModifiedAt;
107    }
108
109    /**
110     *  <p>Present on resources updated after 1 February 2019 except for events not tracked.</p>
111     */
112
113    public com.commercetools.api.models.common.LastModifiedBy getLastModifiedBy() {
114        return this.lastModifiedBy;
115    }
116
117    /**
118     *  <p>Present on resources created after 1 February 2019 except for events not tracked.</p>
119     */
120
121    public com.commercetools.api.models.common.CreatedBy getCreatedBy() {
122        return this.createdBy;
123    }
124
125    /**
126     *  <p>User-defined unique identifier of the AssociateRole.</p>
127     */
128
129    public String getKey() {
130        return this.key;
131    }
132
133    /**
134     *  <p>Whether the AssociateRole can be assigned to an Associate by a buyer. If false, the AssociateRole can only be assigned using the general endpoint.</p>
135     */
136
137    public Boolean getBuyerAssignable() {
138        return this.buyerAssignable;
139    }
140
141    /**
142     *  <p>Name of the AssociateRole.</p>
143     */
144
145    public String getName() {
146        return this.name;
147    }
148
149    /**
150     *  <p>List of Permissions for the AssociateRole.</p>
151     */
152
153    public java.util.List<com.commercetools.api.models.associate_role.Permission> getPermissions() {
154        return this.permissions;
155    }
156
157    /**
158     *  <p>Custom Fields for the AssociateRole.</p>
159     */
160
161    public com.commercetools.api.models.type.CustomFields getCustom() {
162        return this.custom;
163    }
164
165    public void setId(final String id) {
166        this.id = id;
167    }
168
169    public void setVersion(final Long version) {
170        this.version = version;
171    }
172
173    public void setCreatedAt(final java.time.ZonedDateTime createdAt) {
174        this.createdAt = createdAt;
175    }
176
177    public void setLastModifiedAt(final java.time.ZonedDateTime lastModifiedAt) {
178        this.lastModifiedAt = lastModifiedAt;
179    }
180
181    public void setLastModifiedBy(final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy) {
182        this.lastModifiedBy = lastModifiedBy;
183    }
184
185    public void setCreatedBy(final com.commercetools.api.models.common.CreatedBy createdBy) {
186        this.createdBy = createdBy;
187    }
188
189    public void setKey(final String key) {
190        this.key = key;
191    }
192
193    public void setBuyerAssignable(final Boolean buyerAssignable) {
194        this.buyerAssignable = buyerAssignable;
195    }
196
197    public void setName(final String name) {
198        this.name = name;
199    }
200
201    public void setPermissions(final com.commercetools.api.models.associate_role.Permission... permissions) {
202        this.permissions = new ArrayList<>(Arrays.asList(permissions));
203    }
204
205    public void setPermissions(
206            final java.util.List<com.commercetools.api.models.associate_role.Permission> permissions) {
207        this.permissions = permissions;
208    }
209
210    public void setCustom(final com.commercetools.api.models.type.CustomFields custom) {
211        this.custom = custom;
212    }
213
214    @Override
215    public boolean equals(Object o) {
216        if (this == o)
217            return true;
218
219        if (o == null || getClass() != o.getClass())
220            return false;
221
222        AssociateRoleImpl that = (AssociateRoleImpl) o;
223
224        return new EqualsBuilder().append(id, that.id)
225                .append(version, that.version)
226                .append(createdAt, that.createdAt)
227                .append(lastModifiedAt, that.lastModifiedAt)
228                .append(lastModifiedBy, that.lastModifiedBy)
229                .append(createdBy, that.createdBy)
230                .append(key, that.key)
231                .append(buyerAssignable, that.buyerAssignable)
232                .append(name, that.name)
233                .append(permissions, that.permissions)
234                .append(custom, that.custom)
235                .isEquals();
236    }
237
238    @Override
239    public int hashCode() {
240        return new HashCodeBuilder(17, 37).append(id)
241                .append(version)
242                .append(createdAt)
243                .append(lastModifiedAt)
244                .append(lastModifiedBy)
245                .append(createdBy)
246                .append(key)
247                .append(buyerAssignable)
248                .append(name)
249                .append(permissions)
250                .append(custom)
251                .toHashCode();
252    }
253
254}