import Foundation

public struct MeUpdate: Encodable {
    enum CodingKeys: String, CodingKey {
        case displayName = "display_name"
        case handle
        case profileDescription = "profile_description"
        case avatarImageUrl = "avatar_image_url"
    }

    public var displayName: String
    public var handle: String
    public var profileDescription: String
    public var avatarImageUrl: String?

    public init(displayName: String, handle: String, profileDescription: String? = nil, avatarImageUrl: String? = nil) {
        self.displayName = displayName
        self.handle = handle
        self.profileDescription = profileDescription ?? "" // This value is required by the API so we convert nil to ""
        self.avatarImageUrl = avatarImageUrl
    }
}
