All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cohere.api.resources.datasets.requests.DatasetsListRequest Maven / Gradle / Ivy

There is a newer version: 1.4.1
Show newest version
/**
 * This file was auto-generated by Fern from our API Definition.
 */
package com.cohere.api.resources.datasets.requests;

import com.cohere.api.core.ObjectMappers;
import com.cohere.api.types.DatasetValidationStatus;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.time.OffsetDateTime;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonDeserialize(builder = DatasetsListRequest.Builder.class)
public final class DatasetsListRequest {
    private final Optional datasetType;

    private final Optional before;

    private final Optional after;

    private final Optional limit;

    private final Optional offset;

    private final Optional validationStatus;

    private final Map additionalProperties;

    private DatasetsListRequest(
            Optional datasetType,
            Optional before,
            Optional after,
            Optional limit,
            Optional offset,
            Optional validationStatus,
            Map additionalProperties) {
        this.datasetType = datasetType;
        this.before = before;
        this.after = after;
        this.limit = limit;
        this.offset = offset;
        this.validationStatus = validationStatus;
        this.additionalProperties = additionalProperties;
    }

    /**
     * @return optional filter by dataset type
     */
    @JsonProperty("datasetType")
    public Optional getDatasetType() {
        return datasetType;
    }

    /**
     * @return optional filter before a date
     */
    @JsonProperty("before")
    public Optional getBefore() {
        return before;
    }

    /**
     * @return optional filter after a date
     */
    @JsonProperty("after")
    public Optional getAfter() {
        return after;
    }

    /**
     * @return optional limit to number of results
     */
    @JsonProperty("limit")
    public Optional getLimit() {
        return limit;
    }

    /**
     * @return optional offset to start of results
     */
    @JsonProperty("offset")
    public Optional getOffset() {
        return offset;
    }

    /**
     * @return optional filter by validation status
     */
    @JsonProperty("validationStatus")
    public Optional getValidationStatus() {
        return validationStatus;
    }

    @java.lang.Override
    public boolean equals(Object other) {
        if (this == other) return true;
        return other instanceof DatasetsListRequest && equalTo((DatasetsListRequest) other);
    }

    @JsonAnyGetter
    public Map getAdditionalProperties() {
        return this.additionalProperties;
    }

    private boolean equalTo(DatasetsListRequest other) {
        return datasetType.equals(other.datasetType)
                && before.equals(other.before)
                && after.equals(other.after)
                && limit.equals(other.limit)
                && offset.equals(other.offset)
                && validationStatus.equals(other.validationStatus);
    }

    @java.lang.Override
    public int hashCode() {
        return Objects.hash(this.datasetType, this.before, this.after, this.limit, this.offset, this.validationStatus);
    }

    @java.lang.Override
    public String toString() {
        return ObjectMappers.stringify(this);
    }

    public static Builder builder() {
        return new Builder();
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static final class Builder {
        private Optional datasetType = Optional.empty();

        private Optional before = Optional.empty();

        private Optional after = Optional.empty();

        private Optional limit = Optional.empty();

        private Optional offset = Optional.empty();

        private Optional validationStatus = Optional.empty();

        @JsonAnySetter
        private Map additionalProperties = new HashMap<>();

        private Builder() {}

        public Builder from(DatasetsListRequest other) {
            datasetType(other.getDatasetType());
            before(other.getBefore());
            after(other.getAfter());
            limit(other.getLimit());
            offset(other.getOffset());
            validationStatus(other.getValidationStatus());
            return this;
        }

        @JsonSetter(value = "datasetType", nulls = Nulls.SKIP)
        public Builder datasetType(Optional datasetType) {
            this.datasetType = datasetType;
            return this;
        }

        public Builder datasetType(String datasetType) {
            this.datasetType = Optional.of(datasetType);
            return this;
        }

        @JsonSetter(value = "before", nulls = Nulls.SKIP)
        public Builder before(Optional before) {
            this.before = before;
            return this;
        }

        public Builder before(OffsetDateTime before) {
            this.before = Optional.of(before);
            return this;
        }

        @JsonSetter(value = "after", nulls = Nulls.SKIP)
        public Builder after(Optional after) {
            this.after = after;
            return this;
        }

        public Builder after(OffsetDateTime after) {
            this.after = Optional.of(after);
            return this;
        }

        @JsonSetter(value = "limit", nulls = Nulls.SKIP)
        public Builder limit(Optional limit) {
            this.limit = limit;
            return this;
        }

        public Builder limit(Double limit) {
            this.limit = Optional.of(limit);
            return this;
        }

        @JsonSetter(value = "offset", nulls = Nulls.SKIP)
        public Builder offset(Optional offset) {
            this.offset = offset;
            return this;
        }

        public Builder offset(Double offset) {
            this.offset = Optional.of(offset);
            return this;
        }

        @JsonSetter(value = "validationStatus", nulls = Nulls.SKIP)
        public Builder validationStatus(Optional validationStatus) {
            this.validationStatus = validationStatus;
            return this;
        }

        public Builder validationStatus(DatasetValidationStatus validationStatus) {
            this.validationStatus = Optional.of(validationStatus);
            return this;
        }

        public DatasetsListRequest build() {
            return new DatasetsListRequest(
                    datasetType, before, after, limit, offset, validationStatus, additionalProperties);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy