Skip to content

Commit 5fac5ae

Browse files
committed
Add documentation
1 parent e5bca3c commit 5fac5ae

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Sources/Types+List.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ public struct List: Codable, Identifiable {
3030
}
3131

3232
extension List: Fielded {
33+
/// Additional fields that can be requested on the ``List`` object
3334
public typealias Field = PartialKeyPath<Self>
3435

35-
static func fieldName(field: PartialKeyPath<List>) -> String? {
36+
static internal func fieldName(field: PartialKeyPath<List>) -> String? {
3637
switch field {
3738
case \.createdAt: return "created_at"
3839
case \.description: return "description"
@@ -44,11 +45,13 @@ extension List: Fielded {
4445
}
4546
}
4647

47-
static var fieldParameterName = "list.fields"
48+
static internal var fieldParameterName = "list.fields"
4849
}
4950

5051
extension List: Expandable {
52+
/// Fields that can be expanded on the ``List`` type
5153
public enum Expansions: Expansion {
54+
/// The User object for the list’s owner
5255
case ownerId(fields: Set<User.Field>)
5356

5457
internal var rawValue: String {
@@ -69,7 +72,9 @@ extension List: Expandable {
6972
}
7073

7174
extension List {
75+
/// Expanded objects included alongside the ``List``
7276
public struct Includes: Codable {
77+
/// The users expanded with this List. Since ``List.Expansions`` contains only `ownerId`, this will contain the expanded owner User object.
7378
public let users: [User]?
7479
}
7580
}

Sources/Types+Media.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ extension Media {
8484
}
8585

8686
extension Media: Fielded {
87+
/// Additional fields that can be requested on the ``Media`` object
8788
public typealias Field = PartialKeyPath<Self>
8889

8990
static internal func fieldName(field: PartialKeyPath<Media>) -> String? {
@@ -106,13 +107,15 @@ extension Media: Fielded {
106107
}
107108

108109
extension Media {
110+
/// Valid mime types for media that can be uploaded and attached to a Tweet
109111
public enum MimeType: String {
110112
case jpeg = "image/jpeg"
111113
case png = "image/png"
112114
case gif = "image/gif"
113115
case mov = "video/mov"
114116
case mp4 = "video/mp4"
115117

118+
/// The associated media category for a given mime type
116119
var mediaCategory: String {
117120
switch self {
118121
case .jpeg, .png:

0 commit comments

Comments
 (0)