//
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//
// Template used API+CLI
// https://github.com/csjones/SwagGen-templates
//

import Foundation

public class V0AppWebhookUpdateParams: APIModel {

    public var events: String

    public var url: String

    public var headers: String?

    public init(events: String, url: String, headers: String? = nil) {
        self.events = events
        self.url = url
        self.headers = headers
    }

    public required init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: StringCodingKey.self)

        events = try container.decode("events")
        url = try container.decode("url")
        headers = try container.decodeIfPresent("headers")
    }

    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: StringCodingKey.self)

        try container.encode(events, forKey: "events")
        try container.encode(url, forKey: "url")
        try container.encodeIfPresent(headers, forKey: "headers")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? V0AppWebhookUpdateParams else { return false }
      guard self.events == object.events else { return false }
      guard self.url == object.url else { return false }
      guard self.headers == object.headers else { return false }
      return true
    }

    public static func == (lhs: V0AppWebhookUpdateParams, rhs: V0AppWebhookUpdateParams) -> Bool {
        return lhs.isEqual(to: rhs)
    }
}
