//
//  Commit.swift
//  ManageYourStars
//
//  Created by 陈仕鹏 on 06/09/18.
//  Copyright © 2017 csp. All rights reserved.
//
//  -- auto-generated by JSON2Swift --
//

import Foundation

public struct Commit: Codable,Identifiable {
    public var id:String{sha!}
    var message: String?
    var author: Author?
//    var distinct: Bool?
//    var url: String?
    var commit:InnerCommit?
    var sha: String?
//    var comment_count: Int?
//    var tree: Tree?
//    var committer: Committer?
//    var verification: Verification?
    
//    private enum CodingKeys: String, CodingKey {
//        case id
//        case message
//        case author
//        case sha
//    }
//
//    public init(from decoder: Decoder) throws {
//        let container = try decoder.container(keyedBy: CodingKeys.self)
//        if container.contains(.message){
//            message = try container.decode(String.self, forKey: .message)
//        }
//        if container.contains(.author){
//            author = try container.decode(Author.self, forKey: .author)
//        }
//        sha = try container.decode(String.self, forKey: .sha)
//    }
//
//    public func encode(to encoder: Encoder) throws {
//        var container = encoder.container(keyedBy: CodingKeys.self)
//        try container.encode(message, forKey: .message)
//        try container.encode(author, forKey: .author)
//        try container.encode(sha, forKey: .sha)
//        try container.encode(id, forKey: .id)
//    }
}



