@@ -29,7 +29,7 @@ public class StreamClientFactory : IStreamClientFactory
29
29
/// Initializes a new instance of the <see cref="StreamClientFactory"/> class.
30
30
/// This constructor uses STREAM_KEY and STREAM_SECRET environment
31
31
/// variables to initialize the client.
32
- /// If they don't exist, it'll throw an <see cref="ArgumentNullException"/>.
32
+ /// If they don't exist, <see cref="ArgumentNullException"/> will be thrown .
33
33
/// </summary>
34
34
/// <exception cref="ArgumentNullException">If API key or API secret is null.</exception>
35
35
public StreamClientFactory ( ) : this ( null , null , null )
@@ -67,11 +67,12 @@ public StreamClientFactory(string apiKey, string apiSecret, Action<ClientOptions
67
67
var opts = new ClientOptions ( ) ;
68
68
opts . OverrideWithEnvVars ( ) ;
69
69
clientOptionsConfigurer ? . Invoke ( opts ) ;
70
+ opts . EnsureValid ( ) ;
70
71
71
72
var jwtGeneratorClient = new JwtGeneratorClient ( ) ;
72
73
var generatedJwt = jwtGeneratorClient . GenerateServerSideJwt ( apiSecret ) ;
73
74
var assemblyVersion = typeof ( StreamClientFactory ) . GetTypeInfo ( ) . Assembly . GetName ( ) . Version ;
74
- var sdkVersion = string . Join ( "." , assemblyVersion . Major , assemblyVersion . Minor , assemblyVersion . Build ) ;
75
+ var sdkVersion = assemblyVersion . ToString ( 3 ) ;
75
76
var restClient = new RestClient ( opts , generatedJwt , apiKey , sdkVersion ) ;
76
77
77
78
_appClient = new AppClient ( restClient , apiSecret ) ;
@@ -90,29 +91,17 @@ public StreamClientFactory(string apiKey, string apiSecret, Action<ClientOptions
90
91
}
91
92
92
93
public IAppClient GetAppClient ( ) => _appClient ;
93
-
94
94
public IBlocklistClient GetBlocklistClient ( ) => _blocklistClient ;
95
-
96
95
public IChannelClient GetChannelClient ( ) => _channelClient ;
97
-
98
96
public IChannelTypeClient GetChannelTypeClient ( ) => _channelTypeClient ;
99
-
100
97
public ICommandClient GetCommandClient ( ) => _commandClient ;
101
-
102
98
public IDeviceClient GetDeviceClient ( ) => _deviceClient ;
103
-
104
99
public IEventClient GetEventClient ( ) => _eventClient ;
105
-
106
100
public IFlagClient GetFlagClient ( ) => _flagClient ;
107
-
108
101
public IMessageClient GetMessageClient ( ) => _messageClient ;
109
-
110
102
public IPermissionClient GetPermissionClient ( ) => _permissionClient ;
111
-
112
103
public IReactionClient GetReactionClient ( ) => _reactionClient ;
113
-
114
104
public ITaskClient GetTaskClient ( ) => _taskClient ;
115
-
116
105
public IUserClient GetUserClient ( ) => _userClient ;
117
106
}
118
107
}
0 commit comments