/**
 *
 * Please note:
 * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * Do not edit this file manually.
 *
 */
package com.gravatar.restapi.models

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.util.Objects

/**
 * A gallery image a user has uploaded.
 *
 * @param url The URL to the image.
 * @param altText The image alt text.
 */
@JsonClass(generateAdapter = true)
public class GalleryImage internal constructor(
    // The URL to the image.
    @Json(name = "url")
    public val url: java.net.URI,
    // The image alt text.
    @Json(name = "alt_text")
    public val altText: kotlin.String? = null,
) {
    override fun toString(): String = "GalleryImage(url=$url, altText=$altText)"

    override fun equals(other: Any?): Boolean = other is GalleryImage &&
        url == other.url &&
        altText == other.altText

    override fun hashCode(): Int = Objects.hash(url, altText)

    public class Builder {
        // The URL to the image.
        @set:JvmSynthetic // Hide 'void' setter from Java
        public var url: java.net.URI? = null

        // The image alt text.
        @set:JvmSynthetic // Hide 'void' setter from Java
        public var altText: kotlin.String? = null

        public fun setUrl(url: java.net.URI?): Builder = apply { this.url = url }

        public fun setAltText(altText: kotlin.String?): Builder = apply { this.altText = altText }

        public fun build(): GalleryImage = GalleryImage(url!!, altText)
    }
}

@JvmSynthetic // Hide from Java callers who should use Builder.
public fun GalleryImage(initializer: GalleryImage.Builder.() -> Unit): GalleryImage {
    return GalleryImage.Builder().apply(initializer).build()
}
