Skip to content

Commit

Permalink
CHORE: Add documentation to the Contributor model (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinaypratap committed Oct 8, 2023
1 parent 1d251d7 commit b39316a
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion Basic-Car-Maintenance/Shared/Models/Contributor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,44 @@

import Foundation

/// A model representing a contributor.
///
/// Contributors are people who have supported this project in any manner.
///
/// - Note: In this project, we don't actually create this ``Contributor``
/// anywhere, we are getting all the contributors from [GitHub's Repository Statistics
/// API](https://api.github.com/repos/mikaelacaron/Basic-Car-Maintenance/contributors)
///
/// On status code of 200, we decode the response into ``SettingsViewModel/contributors``
/// array of ``Contributor`` type and display them in ``ContributorsListView``.
struct Contributor: Codable, Hashable, Identifiable {

/// The handle for the GitHub user account
let login: String

/// The unique identifier for an account
let id: Int

/// The ID used to move between the REST API and the GraphQL API
let nodeID: String

/// The link to profile image of the user
let avatarURL: String

/// The link to user's avatar on Gravatar if they haven't uploaded an avatar directly.
/// - Warning: Deprecated by GitHub in 2014
let gravatarID: String

/// The endpoint for a user's profile data
let url: String

/// The url to this account on GitHub
let htmlURL: String

/// The number of Pull Requests successfully merged
let contributions: Int


/// Keys to be used for encoding and decoding.
enum CodingKeys: String, CodingKey {
case login, id
case nodeID = "nodeId"
Expand Down

0 comments on commit b39316a

Please sign in to comment.