001 002package com.commercetools.importapi.models.importrequests; 003 004import java.time.*; 005import java.util.*; 006 007import com.commercetools.importapi.models.common.ImportResourceType; 008import com.fasterxml.jackson.annotation.JsonCreator; 009import com.fasterxml.jackson.annotation.JsonProperty; 010import com.fasterxml.jackson.databind.annotation.*; 011 012import io.vrap.rmf.base.client.ModelBase; 013import io.vrap.rmf.base.client.utils.Generated; 014 015import org.apache.commons.lang3.builder.EqualsBuilder; 016import org.apache.commons.lang3.builder.HashCodeBuilder; 017 018/** 019 * <p>The request body to import Customers. Contains data for Customers to be created or updated in a Project.</p> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class CustomerImportRequestImpl implements CustomerImportRequest, ModelBase { 023 024 private com.commercetools.importapi.models.common.ImportResourceType type; 025 026 private java.util.List<com.commercetools.importapi.models.customers.CustomerImport> resources; 027 028 /** 029 * create instance with all properties 030 */ 031 @JsonCreator 032 CustomerImportRequestImpl( 033 @JsonProperty("resources") final java.util.List<com.commercetools.importapi.models.customers.CustomerImport> resources) { 034 this.resources = resources; 035 this.type = ImportResourceType.findEnum("customer"); 036 } 037 038 /** 039 * create empty instance 040 */ 041 public CustomerImportRequestImpl() { 042 this.type = ImportResourceType.findEnum("customer"); 043 } 044 045 /** 046 * <p>The resource types that can be imported.</p> 047 */ 048 049 public com.commercetools.importapi.models.common.ImportResourceType getType() { 050 return this.type; 051 } 052 053 /** 054 * <p>The customer import resources of this request.</p> 055 */ 056 057 public java.util.List<com.commercetools.importapi.models.customers.CustomerImport> getResources() { 058 return this.resources; 059 } 060 061 public void setResources(final com.commercetools.importapi.models.customers.CustomerImport... resources) { 062 this.resources = new ArrayList<>(Arrays.asList(resources)); 063 } 064 065 public void setResources( 066 final java.util.List<com.commercetools.importapi.models.customers.CustomerImport> resources) { 067 this.resources = resources; 068 } 069 070 @Override 071 public boolean equals(Object o) { 072 if (this == o) 073 return true; 074 075 if (o == null || getClass() != o.getClass()) 076 return false; 077 078 CustomerImportRequestImpl that = (CustomerImportRequestImpl) o; 079 080 return new EqualsBuilder().append(type, that.type).append(resources, that.resources).isEquals(); 081 } 082 083 @Override 084 public int hashCode() { 085 return new HashCodeBuilder(17, 37).append(type).append(resources).toHashCode(); 086 } 087 088}