package io.swagger.model.core;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.BrAPIResponse;
import io.swagger.model.Context;
import io.swagger.model.Metadata;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;

import java.util.Objects;

@Validated
public class CommonCropListResponse implements BrAPIResponse<CommonCropListResponseResult> {

    @JsonProperty("@context")
    private Context _atContext = null;

    @JsonProperty("metadata")
    private Metadata metadata = null;

    @JsonProperty("result")
    private CommonCropListResponseResult result = null;

    public CommonCropListResponse _atContext(Context _atContext) {
        this._atContext = _atContext;
        return this;
    }

    public void set_atContext(Context _atContext) {
        this._atContext = _atContext;
    }

    public CommonCropListResponse metadata(Metadata metadata) {
        this.metadata = metadata;
        return this;
    }

    @ApiModelProperty(required = true, value = "")
    @Valid
    public Metadata getMetadata() {
        return metadata;
    }

    public void setMetadata(Metadata metadata) {
        this.metadata = metadata;
    }

    public CommonCropListResponse result(CommonCropListResponseResult result) {
        this.result = result;
        return this;
    }

    @ApiModelProperty(required = true, value = "")
    @Valid
    public CommonCropListResponseResult getResult() {
        return result;
    }

    public void setResult(CommonCropListResponseResult result) {
        this.result = result;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CommonCropListResponse that = (CommonCropListResponse) o;
        return Objects.equals(_atContext, that._atContext)
                && Objects.equals(metadata, that.metadata)
                && Objects.equals(result, that.result);
    }

    @Override
    public int hashCode() {
        return Objects.hash(_atContext, metadata, result);
    }
}
