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

com.styra.opa.openapi.models.shared.BatchMixedResults Maven / Gradle / Ivy

The newest version!
/* 
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

package com.styra.opa.openapi.models.shared;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.styra.opa.openapi.utils.Utils;
import java.lang.Object;
import java.lang.Override;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

/**
 * BatchMixedResults - Mixed success and failures.
 */

public class BatchMixedResults {

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("batch_decision_id")
    private Optional batchDecisionId;

    /**
     * If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
     */
    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("metrics")
    private Optional> metrics;

    @JsonInclude(Include.NON_ABSENT)
    @JsonProperty("responses")
    private Optional> responses;

    @JsonCreator
    public BatchMixedResults(
            @JsonProperty("batch_decision_id") Optional batchDecisionId,
            @JsonProperty("metrics") Optional> metrics,
            @JsonProperty("responses") Optional> responses) {
        Utils.checkNotNull(batchDecisionId, "batchDecisionId");
        Utils.checkNotNull(metrics, "metrics");
        Utils.checkNotNull(responses, "responses");
        this.batchDecisionId = batchDecisionId;
        this.metrics = metrics;
        this.responses = responses;
    }
    
    public BatchMixedResults() {
        this(Optional.empty(), Optional.empty(), Optional.empty());
    }

    @JsonIgnore
    public Optional batchDecisionId() {
        return batchDecisionId;
    }

    /**
     * If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
     */
    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional> metrics() {
        return (Optional>) metrics;
    }

    @SuppressWarnings("unchecked")
    @JsonIgnore
    public Optional> responses() {
        return (Optional>) responses;
    }

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

    public BatchMixedResults withBatchDecisionId(String batchDecisionId) {
        Utils.checkNotNull(batchDecisionId, "batchDecisionId");
        this.batchDecisionId = Optional.ofNullable(batchDecisionId);
        return this;
    }

    public BatchMixedResults withBatchDecisionId(Optional batchDecisionId) {
        Utils.checkNotNull(batchDecisionId, "batchDecisionId");
        this.batchDecisionId = batchDecisionId;
        return this;
    }

    /**
     * If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
     */
    public BatchMixedResults withMetrics(Map metrics) {
        Utils.checkNotNull(metrics, "metrics");
        this.metrics = Optional.ofNullable(metrics);
        return this;
    }

    /**
     * If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
     */
    public BatchMixedResults withMetrics(Optional> metrics) {
        Utils.checkNotNull(metrics, "metrics");
        this.metrics = metrics;
        return this;
    }

    public BatchMixedResults withResponses(Map responses) {
        Utils.checkNotNull(responses, "responses");
        this.responses = Optional.ofNullable(responses);
        return this;
    }

    public BatchMixedResults withResponses(Optional> responses) {
        Utils.checkNotNull(responses, "responses");
        this.responses = responses;
        return this;
    }
    
    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        BatchMixedResults other = (BatchMixedResults) o;
        return 
            Objects.deepEquals(this.batchDecisionId, other.batchDecisionId) &&
            Objects.deepEquals(this.metrics, other.metrics) &&
            Objects.deepEquals(this.responses, other.responses);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(
            batchDecisionId,
            metrics,
            responses);
    }
    
    @Override
    public String toString() {
        return Utils.toString(BatchMixedResults.class,
                "batchDecisionId", batchDecisionId,
                "metrics", metrics,
                "responses", responses);
    }
    
    public final static class Builder {
 
        private Optional batchDecisionId = Optional.empty();
 
        private Optional> metrics = Optional.empty();
 
        private Optional> responses = Optional.empty();  
        
        private Builder() {
          // force use of static builder() method
        }

        public Builder batchDecisionId(String batchDecisionId) {
            Utils.checkNotNull(batchDecisionId, "batchDecisionId");
            this.batchDecisionId = Optional.ofNullable(batchDecisionId);
            return this;
        }

        public Builder batchDecisionId(Optional batchDecisionId) {
            Utils.checkNotNull(batchDecisionId, "batchDecisionId");
            this.batchDecisionId = batchDecisionId;
            return this;
        }

        /**
         * If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
         */
        public Builder metrics(Map metrics) {
            Utils.checkNotNull(metrics, "metrics");
            this.metrics = Optional.ofNullable(metrics);
            return this;
        }

        /**
         * If query metrics are enabled, this field contains query performance metrics collected during the parse, compile, and evaluation steps.
         */
        public Builder metrics(Optional> metrics) {
            Utils.checkNotNull(metrics, "metrics");
            this.metrics = metrics;
            return this;
        }

        public Builder responses(Map responses) {
            Utils.checkNotNull(responses, "responses");
            this.responses = Optional.ofNullable(responses);
            return this;
        }

        public Builder responses(Optional> responses) {
            Utils.checkNotNull(responses, "responses");
            this.responses = responses;
            return this;
        }
        
        public BatchMixedResults build() {
            return new BatchMixedResults(
                batchDecisionId,
                metrics,
                responses);
        }
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy