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

com.squareup.square.legacy.models.RetrieveBookingResponse Maven / Gradle / Ivy

There is a newer version: 44.2.0.20250521
Show newest version
package com.squareup.square.legacy.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.squareup.square.legacy.http.client.HttpContext;
import java.util.List;
import java.util.Objects;

/**
 * This is a model class for RetrieveBookingResponse type.
 */
public class RetrieveBookingResponse {
    private HttpContext httpContext;
    private final Booking booking;
    private final List errors;

    /**
     * Initialization constructor.
     * @param  booking  Booking value for booking.
     * @param  errors  List of Error value for errors.
     */
    @JsonCreator
    public RetrieveBookingResponse(
            @JsonProperty("booking") Booking booking, @JsonProperty("errors") List errors) {
        this.booking = booking;
        this.errors = errors;
    }

    @JsonIgnore
    public HttpContext getContext() {
        return httpContext;
    }

    /**
     * Getter for Booking.
     * Represents a booking as a time-bound service contract for a seller's staff member to provide
     * a specified service at a given location to a requesting customer in one or more appointment
     * segments.
     * @return Returns the Booking
     */
    @JsonGetter("booking")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public Booking getBooking() {
        return booking;
    }

    /**
     * Getter for Errors.
     * Errors that occurred during the request.
     * @return Returns the List of Error
     */
    @JsonGetter("errors")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public List getErrors() {
        return errors;
    }

    @Override
    public int hashCode() {
        return Objects.hash(booking, errors);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof RetrieveBookingResponse)) {
            return false;
        }
        RetrieveBookingResponse other = (RetrieveBookingResponse) obj;
        return Objects.equals(booking, other.booking) && Objects.equals(errors, other.errors);
    }

    /**
     * Converts this RetrieveBookingResponse into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "RetrieveBookingResponse [" + "booking=" + booking + ", errors=" + errors + "]";
    }

    /**
     * Builds a new {@link RetrieveBookingResponse.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link RetrieveBookingResponse.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder().booking(getBooking()).errors(getErrors());
        return builder;
    }

    /**
     * Class to build instances of {@link RetrieveBookingResponse}.
     */
    public static class Builder {
        private HttpContext httpContext;
        private Booking booking;
        private List errors;

        /**
         * Setter for httpContext.
         * @param  httpContext  HttpContext value for httpContext.
         * @return Builder
         */
        public Builder httpContext(HttpContext httpContext) {
            this.httpContext = httpContext;
            return this;
        }

        /**
         * Setter for booking.
         * @param  booking  Booking value for booking.
         * @return Builder
         */
        public Builder booking(Booking booking) {
            this.booking = booking;
            return this;
        }

        /**
         * Setter for errors.
         * @param  errors  List of Error value for errors.
         * @return Builder
         */
        public Builder errors(List errors) {
            this.errors = errors;
            return this;
        }

        /**
         * Builds a new {@link RetrieveBookingResponse} object using the set fields.
         * @return {@link RetrieveBookingResponse}
         */
        public RetrieveBookingResponse build() {
            RetrieveBookingResponse model = new RetrieveBookingResponse(booking, errors);
            model.httpContext = httpContext;
            return model;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy