001 002package com.commercetools.ml.models.similar_products; 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>Represents a URL path to poll to get the results of an Asynchronous Request.</p> 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class SimilarProductsTaskStatusImpl implements SimilarProductsTaskStatus, ModelBase { 022 023 private com.commercetools.ml.models.common.TaskStatusEnum state; 024 025 private java.time.ZonedDateTime expires; 026 027 private com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult result; 028 029 /** 030 * create instance with all properties 031 */ 032 @JsonCreator 033 SimilarProductsTaskStatusImpl(@JsonProperty("state") final com.commercetools.ml.models.common.TaskStatusEnum state, 034 @JsonProperty("expires") final java.time.ZonedDateTime expires, 035 @JsonProperty("result") final com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult result) { 036 this.state = state; 037 this.expires = expires; 038 this.result = result; 039 } 040 041 /** 042 * create empty instance 043 */ 044 public SimilarProductsTaskStatusImpl() { 045 } 046 047 /** 048 * 049 */ 050 051 public com.commercetools.ml.models.common.TaskStatusEnum getState() { 052 return this.state; 053 } 054 055 /** 056 * <p>The expiry date of the result. You cannot access the result after the expiry date. Default: 1 day after the result first becomes available. This is only available when the TaskStatus state is SUCCESS.</p> 057 */ 058 059 public java.time.ZonedDateTime getExpires() { 060 return this.expires; 061 } 062 063 /** 064 * <p>The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is <code>SUCCESS</code>.</p> 065 */ 066 067 public com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult getResult() { 068 return this.result; 069 } 070 071 public void setState(final com.commercetools.ml.models.common.TaskStatusEnum state) { 072 this.state = state; 073 } 074 075 public void setExpires(final java.time.ZonedDateTime expires) { 076 this.expires = expires; 077 } 078 079 public void setResult(final com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult result) { 080 this.result = result; 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 SimilarProductsTaskStatusImpl that = (SimilarProductsTaskStatusImpl) o; 092 093 return new EqualsBuilder().append(state, that.state) 094 .append(expires, that.expires) 095 .append(result, that.result) 096 .append(state, that.state) 097 .append(expires, that.expires) 098 .append(result, that.result) 099 .isEquals(); 100 } 101 102 @Override 103 public int hashCode() { 104 return new HashCodeBuilder(17, 37).append(state).append(expires).append(result).toHashCode(); 105 } 106 107}