//
// Generated by SwagGen
// https://github.com/yonaskolb/SwagGen
//

import Foundation

public class BoolResponseUpdateSecureTokenFriendlyNameErrorsApiResponseEntity: APIModel {

    public var error: UpdateSecureTokenFriendlyNameErrorsErrorDtoEntity?

    public var isError: Bool?

    public var response: BoolResponseEntity?

    public init(error: UpdateSecureTokenFriendlyNameErrorsErrorDtoEntity? = nil, isError: Bool? = nil, response: BoolResponseEntity? = nil) {
        self.error = error
        self.isError = isError
        self.response = response
    }

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

        error = try container.decodeIfPresent("error")
        isError = try container.decodeIfPresent("isError")
        response = try container.decodeIfPresent("response")
    }

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

        try container.encodeIfPresent(error, forKey: "error")
        try container.encodeIfPresent(isError, forKey: "isError")
        try container.encodeIfPresent(response, forKey: "response")
    }

    public func isEqual(to object: Any?) -> Bool {
      guard let object = object as? BoolResponseUpdateSecureTokenFriendlyNameErrorsApiResponseEntity else { return false }
      guard self.error == object.error else { return false }
      guard self.isError == object.isError else { return false }
      guard self.response == object.response else { return false }
      return true
    }

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