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

com.squareup.square.legacy.models.BatchChangeInventoryResponse 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 BatchChangeInventoryResponse type.
 */
public class BatchChangeInventoryResponse {
    private HttpContext httpContext;
    private final List errors;
    private final List counts;
    private final List changes;

    /**
     * Initialization constructor.
     * @param  errors  List of Error value for errors.
     * @param  counts  List of InventoryCount value for counts.
     * @param  changes  List of InventoryChange value for changes.
     */
    @JsonCreator
    public BatchChangeInventoryResponse(
            @JsonProperty("errors") List errors,
            @JsonProperty("counts") List counts,
            @JsonProperty("changes") List changes) {
        this.errors = errors;
        this.counts = counts;
        this.changes = changes;
    }

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

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

    /**
     * Getter for Counts.
     * The current counts for all objects referenced in the request.
     * @return Returns the List of InventoryCount
     */
    @JsonGetter("counts")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public List getCounts() {
        return counts;
    }

    /**
     * Getter for Changes.
     * Changes created for the request.
     * @return Returns the List of InventoryChange
     */
    @JsonGetter("changes")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    public List getChanges() {
        return changes;
    }

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

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

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

    /**
     * Builds a new {@link BatchChangeInventoryResponse.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link BatchChangeInventoryResponse.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder().errors(getErrors()).counts(getCounts()).changes(getChanges());
        return builder;
    }

    /**
     * Class to build instances of {@link BatchChangeInventoryResponse}.
     */
    public static class Builder {
        private HttpContext httpContext;
        private List errors;
        private List counts;
        private List changes;

        /**
         * Setter for httpContext.
         * @param  httpContext  HttpContext value for httpContext.
         * @return Builder
         */
        public Builder httpContext(HttpContext httpContext) {
            this.httpContext = httpContext;
            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;
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy