//
// ReturnUrlRequest.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

import AnyCodable
import Foundation
import Vapor

/** The request body for the EnvelopeViews::createSender method. */
public final class ReturnUrlRequest: Content, Hashable {
    /** (Optional) The URL to which the user should be redirected after the sending session is complete.  Maximum Length: 500 characters. If the `returnUrl` exceeds this limit, the user is redirected to a truncated URL. */
    public var returnUrl: String?

    public init(returnUrl: String? = nil) {
        self.returnUrl = returnUrl
    }

    public enum CodingKeys: String, CodingKey, CaseIterable {
        case returnUrl
    }

    // Encodable protocol methods

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encodeIfPresent(returnUrl, forKey: .returnUrl)
    }

    public static func == (lhs: ReturnUrlRequest, rhs: ReturnUrlRequest) -> Bool {
        lhs.returnUrl == rhs.returnUrl
    }

    public func hash(into hasher: inout Hasher) {
        hasher.combine(returnUrl?.hashValue)
    }
}
