/**
 *
 * 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 link the user has added to their profile.
 *
 * @param label The label for the link.
 * @param url The URL to the link.
 */
@JsonClass(generateAdapter = true)
public class Link internal constructor(
    // The label for the link.
    @Json(name = "label")
    public val label: kotlin.String,
    // The URL to the link.
    @Json(name = "url")
    public val url: java.net.URI,
) {
    override fun toString(): String = "Link(label=$label, url=$url)"

    override fun equals(other: Any?): Boolean = other is Link &&
        label == other.label &&
        url == other.url

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

    public class Builder {
        // The label for the link.
        @set:JvmSynthetic // Hide 'void' setter from Java
        public var label: kotlin.String? = null

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

        public fun setLabel(label: kotlin.String?): Builder = apply { this.label = label }

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

        public fun build(): Link = Link(label!!, url!!)
    }
}

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