001 002package com.commercetools.api.models.error; 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>Returned when a resource type cannot be created as it has reached its limits.</p> 019 * <p>The limits must be adjusted for this resource before sending the request again.</p> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class GraphQLMaxResourceLimitExceededErrorImpl implements GraphQLMaxResourceLimitExceededError, ModelBase { 023 024 private String code; 025 026 private Map<String, java.lang.Object> values; 027 028 private com.commercetools.api.models.common.ReferenceTypeId exceededResource; 029 030 /** 031 * create instance with all properties 032 */ 033 @JsonCreator 034 GraphQLMaxResourceLimitExceededErrorImpl(@JsonProperty("values") final Map<String, java.lang.Object> values, 035 @JsonProperty("exceededResource") final com.commercetools.api.models.common.ReferenceTypeId exceededResource) { 036 this.values = values; 037 this.exceededResource = exceededResource; 038 this.code = MAX_RESOURCE_LIMIT_EXCEEDED; 039 } 040 041 /** 042 * create empty instance 043 */ 044 public GraphQLMaxResourceLimitExceededErrorImpl() { 045 this.code = MAX_RESOURCE_LIMIT_EXCEEDED; 046 } 047 048 /** 049 * 050 */ 051 052 public String getCode() { 053 return this.code; 054 } 055 056 /** 057 * <p>Error-specific additional fields.</p> 058 */ 059 060 public Map<String, java.lang.Object> values() { 061 return values; 062 } 063 064 /** 065 * <p>Resource type that reached its maximum limit of configured elements (for example, 100 Zones per Project).</p> 066 */ 067 068 public com.commercetools.api.models.common.ReferenceTypeId getExceededResource() { 069 return this.exceededResource; 070 } 071 072 public void setValue(String key, java.lang.Object value) { 073 if (values == null) { 074 values = new HashMap<>(); 075 } 076 values.put(key, value); 077 } 078 079 public void setExceededResource(final com.commercetools.api.models.common.ReferenceTypeId exceededResource) { 080 this.exceededResource = exceededResource; 081 } 082 083 @Override 084 public boolean equals(Object o) { 085 if (this == o) 086 return true; 087 088 if (o == null || getClass() != o.getClass()) 089 return false; 090 091 GraphQLMaxResourceLimitExceededErrorImpl that = (GraphQLMaxResourceLimitExceededErrorImpl) o; 092 093 return new EqualsBuilder().append(code, that.code) 094 .append(values, that.values) 095 .append(exceededResource, that.exceededResource) 096 .append(code, that.code) 097 .append(values, that.values) 098 .append(exceededResource, that.exceededResource) 099 .isEquals(); 100 } 101 102 @Override 103 public int hashCode() { 104 return new HashCodeBuilder(17, 37).append(code).append(values).append(exceededResource).toHashCode(); 105 } 106 107}