Skip to content

Commit db3083e

Browse files
committed
Added missing public initializers and encoding methods ThreadGateUnion types
1 parent 36801de commit db3083e

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Sources/ATProtoKit/Models/Lexicons/app.bsky/Feed/AppBskyFeedThreadgate.swift

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ extension AppBskyLexicon.Feed {
9595
/// The identifier of the object.
9696
public let type = "app.bsky.feed.threadgate#mentionRule"
9797

98+
public init() { }
99+
100+
public init(from decoder: any Decoder) throws { }
101+
102+
public func encode(to encoder: any Encoder) throws {
103+
var container = encoder.container(keyedBy: CodingKeys.self)
104+
try container.encode(self.type, forKey: .type)
105+
}
106+
98107
enum CodingKeys: String, CodingKey {
99108
case type = "$type"
100109
}
@@ -109,6 +118,15 @@ extension AppBskyLexicon.Feed {
109118
/// The identifier of the object.
110119
public let type = "app.bsky.feed.threadgate#followerRule"
111120

121+
public init() { }
122+
123+
public init(from decoder: any Decoder) throws { }
124+
125+
public func encode(to encoder: any Encoder) throws {
126+
var container = encoder.container(keyedBy: CodingKeys.self)
127+
try container.encode(self.type, forKey: .type)
128+
}
129+
112130
enum CodingKeys: String, CodingKey {
113131
case type = "$type"
114132
}
@@ -122,6 +140,15 @@ extension AppBskyLexicon.Feed {
122140
/// The identifier of the object.
123141
public let type = "app.bsky.feed.threadgate#followingRule"
124142

143+
public init() { }
144+
145+
public init(from decoder: any Decoder) throws { }
146+
147+
public func encode(to encoder: any Encoder) throws {
148+
var container = encoder.container(keyedBy: CodingKeys.self)
149+
try container.encode(self.type, forKey: .type)
150+
}
151+
125152
enum CodingKeys: String, CodingKey {
126153
case type = "$type"
127154
}
@@ -138,6 +165,21 @@ extension AppBskyLexicon.Feed {
138165
/// The list itself.
139166
public let listURI: String
140167

168+
public init(listURI: String) {
169+
self.listURI = listURI
170+
}
171+
172+
public init(from decoder: any Decoder) throws {
173+
let container = try decoder.container(keyedBy: CodingKeys.self)
174+
self.listURI = try container.decode(String.self, forKey: .listURI)
175+
}
176+
177+
public func encode(to encoder: any Encoder) throws {
178+
var container = encoder.container(keyedBy: CodingKeys.self)
179+
try container.encode(self.type, forKey: .type)
180+
try container.encode(self.listURI, forKey: .listURI)
181+
}
182+
141183
enum CodingKeys: String, CodingKey {
142184
case type = "$type"
143185
case listURI = "list"

0 commit comments

Comments
 (0)