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

com.squareup.square.legacy.models.CatalogImage 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.Objects;

/**
 * This is a model class for CatalogImage type.
 */
public class CatalogImage {
    private final OptionalNullable name;
    private final OptionalNullable url;
    private final OptionalNullable caption;
    private final OptionalNullable photoStudioOrderId;

    /**
     * Initialization constructor.
     * @param  name  String value for name.
     * @param  url  String value for url.
     * @param  caption  String value for caption.
     * @param  photoStudioOrderId  String value for photoStudioOrderId.
     */
    @JsonCreator
    public CatalogImage(
            @JsonProperty("name") String name,
            @JsonProperty("url") String url,
            @JsonProperty("caption") String caption,
            @JsonProperty("photo_studio_order_id") String photoStudioOrderId) {
        this.name = OptionalNullable.of(name);
        this.url = OptionalNullable.of(url);
        this.caption = OptionalNullable.of(caption);
        this.photoStudioOrderId = OptionalNullable.of(photoStudioOrderId);
    }

    /**
     * Initialization constructor.
     * @param  name  String value for name.
     * @param  url  String value for url.
     * @param  caption  String value for caption.
     * @param  photoStudioOrderId  String value for photoStudioOrderId.
     */
    protected CatalogImage(
            OptionalNullable name,
            OptionalNullable url,
            OptionalNullable caption,
            OptionalNullable photoStudioOrderId) {
        this.name = name;
        this.url = url;
        this.caption = caption;
        this.photoStudioOrderId = photoStudioOrderId;
    }

    /**
     * Internal Getter for Name.
     * The internal name to identify this image in calls to the Square API. This is a searchable
     * attribute for use in applicable query filters using the
     * [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). It is not unique and
     * should not be shown in a buyer facing context.
     * @return Returns the Internal String
     */
    @JsonGetter("name")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetName() {
        return this.name;
    }

    /**
     * Getter for Name.
     * The internal name to identify this image in calls to the Square API. This is a searchable
     * attribute for use in applicable query filters using the
     * [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects). It is not unique and
     * should not be shown in a buyer facing context.
     * @return Returns the String
     */
    @JsonIgnore
    public String getName() {
        return OptionalNullable.getFrom(name);
    }

    /**
     * Internal Getter for Url.
     * The URL of this image, generated by Square after an image is uploaded using the
     * [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint. To modify the image,
     * use the UpdateCatalogImage endpoint. Do not change the URL field.
     * @return Returns the Internal String
     */
    @JsonGetter("url")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetUrl() {
        return this.url;
    }

    /**
     * Getter for Url.
     * The URL of this image, generated by Square after an image is uploaded using the
     * [CreateCatalogImage](api-endpoint:Catalog-CreateCatalogImage) endpoint. To modify the image,
     * use the UpdateCatalogImage endpoint. Do not change the URL field.
     * @return Returns the String
     */
    @JsonIgnore
    public String getUrl() {
        return OptionalNullable.getFrom(url);
    }

    /**
     * Internal Getter for Caption.
     * A caption that describes what is shown in the image. Displayed in the Square Online Store.
     * This is a searchable attribute for use in applicable query filters using the
     * [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).
     * @return Returns the Internal String
     */
    @JsonGetter("caption")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetCaption() {
        return this.caption;
    }

    /**
     * Getter for Caption.
     * A caption that describes what is shown in the image. Displayed in the Square Online Store.
     * This is a searchable attribute for use in applicable query filters using the
     * [SearchCatalogObjects](api-endpoint:Catalog-SearchCatalogObjects).
     * @return Returns the String
     */
    @JsonIgnore
    public String getCaption() {
        return OptionalNullable.getFrom(caption);
    }

    /**
     * Internal Getter for PhotoStudioOrderId.
     * The immutable order ID for this image object created by the Photo Studio service in Square
     * Online Store.
     * @return Returns the Internal String
     */
    @JsonGetter("photo_studio_order_id")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetPhotoStudioOrderId() {
        return this.photoStudioOrderId;
    }

    /**
     * Getter for PhotoStudioOrderId.
     * The immutable order ID for this image object created by the Photo Studio service in Square
     * Online Store.
     * @return Returns the String
     */
    @JsonIgnore
    public String getPhotoStudioOrderId() {
        return OptionalNullable.getFrom(photoStudioOrderId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, url, caption, photoStudioOrderId);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof CatalogImage)) {
            return false;
        }
        CatalogImage other = (CatalogImage) obj;
        return Objects.equals(name, other.name)
                && Objects.equals(url, other.url)
                && Objects.equals(caption, other.caption)
                && Objects.equals(photoStudioOrderId, other.photoStudioOrderId);
    }

    /**
     * Converts this CatalogImage into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "CatalogImage [" + "name=" + name + ", url=" + url + ", caption=" + caption + ", photoStudioOrderId="
                + photoStudioOrderId + "]";
    }

    /**
     * Builds a new {@link CatalogImage.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link CatalogImage.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder();
        builder.name = internalGetName();
        builder.url = internalGetUrl();
        builder.caption = internalGetCaption();
        builder.photoStudioOrderId = internalGetPhotoStudioOrderId();
        return builder;
    }

    /**
     * Class to build instances of {@link CatalogImage}.
     */
    public static class Builder {
        private OptionalNullable name;
        private OptionalNullable url;
        private OptionalNullable caption;
        private OptionalNullable photoStudioOrderId;

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

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

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

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

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

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

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

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

        /**
         * Builds a new {@link CatalogImage} object using the set fields.
         * @return {@link CatalogImage}
         */
        public CatalogImage build() {
            return new CatalogImage(name, url, caption, photoStudioOrderId);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy