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

com.styra.opa.openapi.models.errors.BatchServerError Maven / Gradle / Ivy

/* 
 * Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
 */

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

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
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.fasterxml.jackson.core.type.TypeReference;
import com.styra.opa.openapi.utils.Utils;
import java.io.InputStream;
import java.lang.Deprecated;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.http.HttpResponse;
import java.util.Optional;

public class BatchServerError extends RuntimeException {

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

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

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

    public Optional batchDecisionId(){
        return batchDecisionId;
    }

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

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

    public BatchServerError withResponses(java.util.Map responses) {
        Utils.checkNotNull(responses, "responses");
        this.responses = Optional.ofNullable(responses);
        return this;
    }
    
    public BatchServerError 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;
        }
        BatchServerError other = (BatchServerError) o;
        return
            java.util.Objects.deepEquals(this.batchDecisionId, other.batchDecisionId) &&
            java.util.Objects.deepEquals(this.responses, other.responses);
    }

    @Override
    public int hashCode() {
        return java.util.Objects.hash(
            batchDecisionId,
            responses);
    }

    @Override
    public String toString() {
        return Utils.toString(BatchServerError.class,
                "batchDecisionId", batchDecisionId,
                "responses", responses);
    }

    public final static class Builder {

        private Optional batchDecisionId = 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;
        }

        public Builder responses(java.util.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 BatchServerError build() {
            return new BatchServerError(
                batchDecisionId,
                responses);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy