4
4
5
5
import Foundation
6
6
7
+ // MARK: - Standard Encodable Conformances
8
+
9
+ //
10
+ // The types below are simple enums or value types and are made to conform to
11
+ // Encodable using the compiler's default synthesis.
12
+
13
+ extension Stream_Video_Sfu_Models_TrackType : Encodable { }
14
+ extension Stream_Video_Sfu_Models_CallEndedReason : Encodable { }
15
+ extension Stream_Video_Sfu_Models_GoAwayReason : Encodable { }
16
+ extension Stream_Video_Sfu_Models_ErrorCode : Encodable { }
17
+ extension Stream_Video_Sfu_Models_WebsocketReconnectStrategy : Encodable { }
18
+
7
19
// MARK: - SelectiveEncodable Conformances
8
20
9
21
//
@@ -33,14 +45,12 @@ extension Stream_Video_Sfu_Signal_AudioMuteChanged: SelectiveEncodable {}
33
45
extension Stream_Video_Sfu_Signal_VideoMuteChanged : SelectiveEncodable { }
34
46
extension Stream_Video_Sfu_Signal_UpdateSubscriptionsRequest : SelectiveEncodable { }
35
47
extension Stream_Video_Sfu_Signal_UpdateSubscriptionsResponse : SelectiveEncodable { }
36
- extension Stream_Video_Sfu_Signal_TrackSubscriptionDetails : SelectiveEncodable { }
37
48
extension Stream_Video_Sfu_Signal_SendAnswerRequest : SelectiveEncodable { }
38
49
extension Stream_Video_Sfu_Signal_SendAnswerResponse : SelectiveEncodable { }
39
50
extension Stream_Video_Sfu_Signal_ICETrickleResponse : SelectiveEncodable { }
40
51
extension Stream_Video_Sfu_Signal_SetPublisherRequest : SelectiveEncodable { }
41
52
extension Stream_Video_Sfu_Signal_SetPublisherResponse : SelectiveEncodable { }
42
53
extension Stream_Video_Sfu_Models_ICETrickle : SelectiveEncodable { }
43
- extension Stream_Video_Sfu_Event_JoinRequest : SelectiveEncodable { }
44
54
extension Stream_Video_Sfu_Event_LeaveCallRequest : SelectiveEncodable { }
45
55
extension Stream_Video_Sfu_Event_ChangePublishQuality : SelectiveEncodable { }
46
56
extension Stream_Video_Sfu_Event_CallEnded : SelectiveEncodable { }
@@ -51,15 +61,58 @@ extension Stream_Video_Sfu_Event_VideoSender: SelectiveEncodable {}
51
61
extension Stream_Video_Sfu_Models_Codec : SelectiveEncodable { }
52
62
extension Stream_Video_Sfu_Event_VideoLayerSetting : SelectiveEncodable { }
53
63
extension Stream_Video_Sfu_Models_Error : SelectiveEncodable { }
64
+ extension Stream_Video_Sfu_Models_VideoDimension : SelectiveEncodable { }
54
65
55
- // MARK: - Standard Encodable Conformances
66
+ // MARK: - Extended Selective Encodable Conformances
56
67
57
- //
58
- // The types below are simple enums or value types and are made to conform to
59
- // Encodable using the compiler's default synthesis.
68
+ extension Stream_Video_Sfu_Event_JoinRequest : SelectiveEncodable {
69
+ struct EncodableRepresentation : SelectiveEncodable {
70
+ var token : String
71
+ var sessionID : String
72
+ var subscriberSdp : String
73
+ var publisherSdp : String
74
+ var clientDetails : Stream_Video_Sfu_Models_ClientDetails
75
+ var migration : Stream_Video_Sfu_Event_Migration
76
+ var fastReconnect : Bool
77
+ var reconnectDetails : Stream_Video_Sfu_Event_ReconnectDetails
78
+ var preferredPublishOptions : [ Stream_Video_Sfu_Models_PublishOption ]
79
+ var capabilities : [ Stream_Video_Sfu_Models_ClientCapability ]
60
80
61
- extension Stream_Video_Sfu_Models_TrackType : Encodable { }
62
- extension Stream_Video_Sfu_Models_CallEndedReason : Encodable { }
63
- extension Stream_Video_Sfu_Models_GoAwayReason : Encodable { }
64
- extension Stream_Video_Sfu_Models_ErrorCode : Encodable { }
65
- extension Stream_Video_Sfu_Models_WebsocketReconnectStrategy : Encodable { }
81
+ init ( _ source: Stream_Video_Sfu_Event_JoinRequest ) {
82
+ token = source. token
83
+ sessionID = source. sessionID
84
+ subscriberSdp = source. subscriberSdp
85
+ publisherSdp = source. publisherSdp
86
+ clientDetails = source. clientDetails
87
+ migration = source. migration
88
+ fastReconnect = source. fastReconnect
89
+ reconnectDetails = source. reconnectDetails
90
+ preferredPublishOptions = source. preferredPublishOptions
91
+ capabilities = source. capabilities
92
+ }
93
+ }
94
+
95
+ var encodableRepresentation : any Encodable {
96
+ EncodableRepresentation ( self )
97
+ }
98
+ }
99
+
100
+ extension Stream_Video_Sfu_Signal_TrackSubscriptionDetails : SelectiveEncodable {
101
+ struct EncodableRepresentation : SelectiveEncodable {
102
+ var userID : String
103
+ var sessionID : String
104
+ var trackType : Stream_Video_Sfu_Models_TrackType
105
+ var dimension : Stream_Video_Sfu_Models_VideoDimension
106
+
107
+ init ( _ source: Stream_Video_Sfu_Signal_TrackSubscriptionDetails ) {
108
+ userID = source. userID
109
+ sessionID = source. sessionID
110
+ trackType = source. trackType
111
+ dimension = source. dimension
112
+ }
113
+ }
114
+
115
+ var encodableRepresentation : any Encodable {
116
+ EncodableRepresentation ( self )
117
+ }
118
+ }
0 commit comments