001 002package com.commercetools.history.models.change_history; 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 * <p>Information about the user or API Client who performed the change. This is a variant of LastModifiedBy.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ModifiedByImpl implements ModifiedBy, ModelBase { 022 023 private String id; 024 025 private String type; 026 027 private com.commercetools.history.models.common.Reference customer; 028 029 private String anonymousId; 030 031 private String clientId; 032 033 private Boolean isPlatformClient; 034 035 /** 036 * create instance with all properties 037 */ 038 @JsonCreator 039 ModifiedByImpl(@JsonProperty("id") final String id, @JsonProperty("type") final String type, 040 @JsonProperty("customer") final com.commercetools.history.models.common.Reference customer, 041 @JsonProperty("anonymousId") final String anonymousId, @JsonProperty("clientId") final String clientId, 042 @JsonProperty("isPlatformClient") final Boolean isPlatformClient) { 043 this.id = id; 044 this.type = type; 045 this.customer = customer; 046 this.anonymousId = anonymousId; 047 this.clientId = clientId; 048 this.isPlatformClient = isPlatformClient; 049 } 050 051 /** 052 * create empty instance 053 */ 054 public ModifiedByImpl() { 055 } 056 057 /** 058 * <p>ID of the Merchant Center user who made the change.</p> 059 * <p>Present only if the change was made in the Merchant Center.</p> 060 */ 061 062 public String getId() { 063 return this.id; 064 } 065 066 /** 067 * <p>Indicates who performed the change.</p> 068 * <ul> 069 * <li>If the change was made by a user, the value is <code>"user"</code>.</li> 070 * <li>If the change was made by an API Client with or without an external user ID, the value is <code>"external-user"</code>.</li> 071 * </ul> 072 */ 073 074 public String getType() { 075 return this.type; 076 } 077 078 /** 079 * <p>Reference to the Customer who made the change.</p> 080 * <p>Present only if the change was made using a token from the password flow.</p> 081 */ 082 083 public com.commercetools.history.models.common.Reference getCustomer() { 084 return this.customer; 085 } 086 087 /** 088 * <p>Present only if the change was made using a token from an anonymous session.</p> 089 */ 090 091 public String getAnonymousId() { 092 return this.anonymousId; 093 } 094 095 /** 096 * <p>ID of the API Client that made the change.</p> 097 * <p>Present only if the change was made using an API Client.</p> 098 */ 099 100 public String getClientId() { 101 return this.clientId; 102 } 103 104 /** 105 * <p><code>true</code> if the change was made using the Merchant Center or ImpEx.</p> 106 */ 107 108 public Boolean getIsPlatformClient() { 109 return this.isPlatformClient; 110 } 111 112 public void setId(final String id) { 113 this.id = id; 114 } 115 116 public void setType(final String type) { 117 this.type = type; 118 } 119 120 public void setCustomer(final com.commercetools.history.models.common.Reference customer) { 121 this.customer = customer; 122 } 123 124 public void setAnonymousId(final String anonymousId) { 125 this.anonymousId = anonymousId; 126 } 127 128 public void setClientId(final String clientId) { 129 this.clientId = clientId; 130 } 131 132 public void setIsPlatformClient(final Boolean isPlatformClient) { 133 this.isPlatformClient = isPlatformClient; 134 } 135 136 @Override 137 public boolean equals(Object o) { 138 if (this == o) 139 return true; 140 141 if (o == null || getClass() != o.getClass()) 142 return false; 143 144 ModifiedByImpl that = (ModifiedByImpl) o; 145 146 return new EqualsBuilder().append(id, that.id) 147 .append(type, that.type) 148 .append(customer, that.customer) 149 .append(anonymousId, that.anonymousId) 150 .append(clientId, that.clientId) 151 .append(isPlatformClient, that.isPlatformClient) 152 .append(id, that.id) 153 .append(type, that.type) 154 .append(customer, that.customer) 155 .append(anonymousId, that.anonymousId) 156 .append(clientId, that.clientId) 157 .append(isPlatformClient, that.isPlatformClient) 158 .isEquals(); 159 } 160 161 @Override 162 public int hashCode() { 163 return new HashCodeBuilder(17, 37).append(id) 164 .append(type) 165 .append(customer) 166 .append(anonymousId) 167 .append(clientId) 168 .append(isPlatformClient) 169 .toHashCode(); 170 } 171 172}