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

com.squareup.square.legacy.models.SearchLoyaltyAccountsRequestLoyaltyAccountQuery 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.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.apimatic.core.types.OptionalNullable;
import java.util.List;
import java.util.Objects;

/**
 * This is a model class for SearchLoyaltyAccountsRequestLoyaltyAccountQuery type.
 */
public class SearchLoyaltyAccountsRequestLoyaltyAccountQuery {
    private final OptionalNullable> mappings;
    private final OptionalNullable> customerIds;

    /**
     * Initialization constructor.
     * @param  mappings  List of LoyaltyAccountMapping value for mappings.
     * @param  customerIds  List of String value for customerIds.
     */
    @JsonCreator
    public SearchLoyaltyAccountsRequestLoyaltyAccountQuery(
            @JsonProperty("mappings") List mappings,
            @JsonProperty("customer_ids") List customerIds) {
        this.mappings = OptionalNullable.of(mappings);
        this.customerIds = OptionalNullable.of(customerIds);
    }

    /**
     * Initialization constructor.
     * @param  mappings  List of LoyaltyAccountMapping value for mappings.
     * @param  customerIds  List of String value for customerIds.
     */
    protected SearchLoyaltyAccountsRequestLoyaltyAccountQuery(
            OptionalNullable> mappings, OptionalNullable> customerIds) {
        this.mappings = mappings;
        this.customerIds = customerIds;
    }

    /**
     * Internal Getter for Mappings.
     * The set of mappings to use in the loyalty account search. This cannot be combined with
     * `customer_ids`. Max: 30 mappings
     * @return Returns the Internal List of LoyaltyAccountMapping
     */
    @JsonGetter("mappings")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable> internalGetMappings() {
        return this.mappings;
    }

    /**
     * Getter for Mappings.
     * The set of mappings to use in the loyalty account search. This cannot be combined with
     * `customer_ids`. Max: 30 mappings
     * @return Returns the List of LoyaltyAccountMapping
     */
    @JsonIgnore
    public List getMappings() {
        return OptionalNullable.getFrom(mappings);
    }

    /**
     * Internal Getter for CustomerIds.
     * The set of customer IDs to use in the loyalty account search. This cannot be combined with
     * `mappings`. Max: 30 customer IDs
     * @return Returns the Internal List of String
     */
    @JsonGetter("customer_ids")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable> internalGetCustomerIds() {
        return this.customerIds;
    }

    /**
     * Getter for CustomerIds.
     * The set of customer IDs to use in the loyalty account search. This cannot be combined with
     * `mappings`. Max: 30 customer IDs
     * @return Returns the List of String
     */
    @JsonIgnore
    public List getCustomerIds() {
        return OptionalNullable.getFrom(customerIds);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mappings, customerIds);
    }

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

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

    /**
     * Builds a new {@link SearchLoyaltyAccountsRequestLoyaltyAccountQuery.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link SearchLoyaltyAccountsRequestLoyaltyAccountQuery.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder();
        builder.mappings = internalGetMappings();
        builder.customerIds = internalGetCustomerIds();
        return builder;
    }

    /**
     * Class to build instances of {@link SearchLoyaltyAccountsRequestLoyaltyAccountQuery}.
     */
    public static class Builder {
        private OptionalNullable> mappings;
        private OptionalNullable> customerIds;

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

        /**
         * UnSetter for mappings.
         * @return Builder
         */
        public Builder unsetMappings() {
            mappings = null;
            return this;
        }

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

        /**
         * UnSetter for customerIds.
         * @return Builder
         */
        public Builder unsetCustomerIds() {
            customerIds = null;
            return this;
        }

        /**
         * Builds a new {@link SearchLoyaltyAccountsRequestLoyaltyAccountQuery} object using the set
         * fields.
         * @return {@link SearchLoyaltyAccountsRequestLoyaltyAccountQuery}
         */
        public SearchLoyaltyAccountsRequestLoyaltyAccountQuery build() {
            return new SearchLoyaltyAccountsRequestLoyaltyAccountQuery(mappings, customerIds);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy