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

com.merge.api.resources.ticketing.tickets.requests.PatchedTicketEndpointRequest Maven / Gradle / Ivy

package com.merge.api.resources.ticketing.tickets.requests;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
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 com.merge.api.resources.ticketing.types.PatchedTicketRequest;
import java.util.Objects;
import java.util.Optional;

@JsonDeserialize(builder = PatchedTicketEndpointRequest.Builder.class)
public final class PatchedTicketEndpointRequest {
    private final Optional isDebugMode;

    private final Optional runAsync;

    private final PatchedTicketRequest model;

    private PatchedTicketEndpointRequest(
            Optional isDebugMode, Optional runAsync, PatchedTicketRequest model) {
        this.isDebugMode = isDebugMode;
        this.runAsync = runAsync;
        this.model = model;
    }

    /**
     * @return Whether to include debug fields (such as log file links) in the response.
     */
    @JsonProperty("is_debug_mode")
    public Optional getIsDebugMode() {
        return isDebugMode;
    }

    /**
     * @return Whether or not third-party updates should be run asynchronously.
     */
    @JsonProperty("run_async")
    public Optional getRunAsync() {
        return runAsync;
    }

    @JsonProperty("model")
    public PatchedTicketRequest getModel() {
        return model;
    }

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

    private boolean equalTo(PatchedTicketEndpointRequest other) {
        return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model);
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.isDebugMode, this.runAsync, this.model);
    }

    @Override
    public String toString() {
        return "PatchedTicketEndpointRequest{" + "isDebugMode: " + isDebugMode + ", runAsync: " + runAsync + ", model: "
                + model + "}";
    }

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

    public interface ModelStage {
        _FinalStage model(PatchedTicketRequest model);

        Builder from(PatchedTicketEndpointRequest other);
    }

    public interface _FinalStage {
        PatchedTicketEndpointRequest build();

        _FinalStage isDebugMode(Optional isDebugMode);

        _FinalStage isDebugMode(Boolean isDebugMode);

        _FinalStage runAsync(Optional runAsync);

        _FinalStage runAsync(Boolean runAsync);
    }

    @JsonIgnoreProperties(ignoreUnknown = true)
    public static final class Builder implements ModelStage, _FinalStage {
        private PatchedTicketRequest model;

        private Optional runAsync = Optional.empty();

        private Optional isDebugMode = Optional.empty();

        private Builder() {}

        @Override
        public Builder from(PatchedTicketEndpointRequest other) {
            isDebugMode(other.getIsDebugMode());
            runAsync(other.getRunAsync());
            model(other.getModel());
            return this;
        }

        @Override
        @JsonSetter("model")
        public _FinalStage model(PatchedTicketRequest model) {
            this.model = model;
            return this;
        }

        /**
         * 

Whether or not third-party updates should be run asynchronously.

* @return Reference to {@code this} so that method calls can be chained together. */ @Override public _FinalStage runAsync(Boolean runAsync) { this.runAsync = Optional.of(runAsync); return this; } @Override @JsonSetter(value = "run_async", nulls = Nulls.SKIP) public _FinalStage runAsync(Optional runAsync) { this.runAsync = runAsync; return this; } /** *

Whether to include debug fields (such as log file links) in the response.

* @return Reference to {@code this} so that method calls can be chained together. */ @Override public _FinalStage isDebugMode(Boolean isDebugMode) { this.isDebugMode = Optional.of(isDebugMode); return this; } @Override @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) public _FinalStage isDebugMode(Optional isDebugMode) { this.isDebugMode = isDebugMode; return this; } @Override public PatchedTicketEndpointRequest build() { return new PatchedTicketEndpointRequest(isDebugMode, runAsync, model); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy