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    @JsonCreator
030    SimilarProductsTaskStatusImpl(@JsonProperty("state") final com.commercetools.ml.models.common.TaskStatusEnum state,
031            @JsonProperty("expires") final java.time.ZonedDateTime expires,
032            @JsonProperty("result") final com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult result) {
033        this.state = state;
034        this.expires = expires;
035        this.result = result;
036    }
037
038    public SimilarProductsTaskStatusImpl() {
039    }
040
041    /**
042     *
043     */
044
045    public com.commercetools.ml.models.common.TaskStatusEnum getState() {
046        return this.state;
047    }
048
049    /**
050     *  <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>
051     */
052
053    public java.time.ZonedDateTime getExpires() {
054        return this.expires;
055    }
056
057    /**
058     *  <p>The response to an asynchronous request. The type depends on the request initiated. Only populated when the status is <code>SUCCESS</code>.</p>
059     */
060
061    public com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult getResult() {
062        return this.result;
063    }
064
065    public void setState(final com.commercetools.ml.models.common.TaskStatusEnum state) {
066        this.state = state;
067    }
068
069    public void setExpires(final java.time.ZonedDateTime expires) {
070        this.expires = expires;
071    }
072
073    public void setResult(final com.commercetools.ml.models.similar_products.SimilarProductsPagedQueryResult result) {
074        this.result = result;
075    }
076
077    @Override
078    public boolean equals(Object o) {
079        if (this == o)
080            return true;
081
082        if (o == null || getClass() != o.getClass())
083            return false;
084
085        SimilarProductsTaskStatusImpl that = (SimilarProductsTaskStatusImpl) o;
086
087        return new EqualsBuilder().append(state, that.state)
088                .append(expires, that.expires)
089                .append(result, that.result)
090                .isEquals();
091    }
092
093    @Override
094    public int hashCode() {
095        return new HashCodeBuilder(17, 37).append(state).append(expires).append(result).toHashCode();
096    }
097
098}