10
10
#nullable enable
11
11
namespace Codat . Platform
12
12
{
13
+ using Codat . Platform . Hooks ;
13
14
using Codat . Platform . Models . Errors ;
14
15
using Codat . Platform . Models . Shared ;
15
16
using Codat . Platform . Utils ;
@@ -117,16 +118,28 @@ public class SDKConfig
117
118
"https://api.codat.io" ,
118
119
} ;
119
120
120
- public string serverUrl = "" ;
121
- public int serverIndex = 0 ;
121
+ public string ServerUrl = "" ;
122
+ public int ServerIndex = 0 ;
123
+ public SDKHooks hooks = new SDKHooks ( ) ;
122
124
123
- public string GetTemplatedServerDetails ( )
125
+ public string GetTemplatedServerUrl ( )
124
126
{
125
- if ( ! String . IsNullOrEmpty ( this . serverUrl ) )
127
+ if ( ! String . IsNullOrEmpty ( this . ServerUrl ) )
126
128
{
127
- return Utilities . TemplateUrl ( Utilities . RemoveSuffix ( this . serverUrl , "/" ) , new Dictionary < string , string > ( ) ) ;
129
+ return Utilities . TemplateUrl ( Utilities . RemoveSuffix ( this . ServerUrl , "/" ) , new Dictionary < string , string > ( ) ) ;
128
130
}
129
- return Utilities . TemplateUrl ( SDKConfig . ServerList [ this . serverIndex ] , new Dictionary < string , string > ( ) ) ;
131
+ return Utilities . TemplateUrl ( SDKConfig . ServerList [ this . ServerIndex ] , new Dictionary < string , string > ( ) ) ;
132
+ }
133
+
134
+ public ISpeakeasyHttpClient InitHooks ( ISpeakeasyHttpClient client )
135
+ {
136
+ string preHooksUrl = GetTemplatedServerUrl ( ) ;
137
+ var ( postHooksUrl , postHooksClient ) = this . hooks . SDKInit ( preHooksUrl , client ) ;
138
+ if ( preHooksUrl != postHooksUrl )
139
+ {
140
+ this . ServerUrl = postHooksUrl ;
141
+ }
142
+ return postHooksClient ;
130
143
}
131
144
}
132
145
@@ -165,10 +178,10 @@ public class CodatPlatform: ICodatPlatform
165
178
public SDKConfig SDKConfiguration { get ; private set ; }
166
179
167
180
private const string _language = "csharp" ;
168
- private const string _sdkVersion = "3.6.0 " ;
169
- private const string _sdkGenVersion = "2.314.0 " ;
181
+ private const string _sdkVersion = "3.6.1 " ;
182
+ private const string _sdkGenVersion = "2.319.7 " ;
170
183
private const string _openapiDocVersion = "3.0.0" ;
171
- private const string _userAgent = "speakeasy-sdk/csharp 3.6.0 2.314.0 3.0.0 Codat.Platform" ;
184
+ private const string _userAgent = "speakeasy-sdk/csharp 3.6.1 2.319.7 3.0.0 Codat.Platform" ;
172
185
private string _serverUrl = "" ;
173
186
private int _serverIndex = 0 ;
174
187
private ISpeakeasyHttpClient _defaultClient ;
@@ -222,21 +235,44 @@ public CodatPlatform(Security? security = null, Func<Security>? securitySource =
222
235
223
236
SDKConfiguration = new SDKConfig ( )
224
237
{
225
- serverIndex = _serverIndex ,
226
- serverUrl = _serverUrl
238
+ ServerIndex = _serverIndex ,
239
+ ServerUrl = _serverUrl
227
240
} ;
228
241
242
+ _defaultClient = SDKConfiguration . InitHooks ( _defaultClient ) ;
243
+
244
+
229
245
Settings = new Settings ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
246
+
247
+
230
248
Companies = new Companies ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
249
+
250
+
231
251
ConnectionManagement = new ConnectionManagement ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
252
+
253
+
232
254
Connections = new Connections ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
255
+
256
+
233
257
CustomDataType = new CustomDataType ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
258
+
259
+
234
260
PushData = new PushData ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
261
+
262
+
235
263
RefreshData = new RefreshData ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
264
+
265
+
236
266
Groups = new Groups ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
267
+
268
+
237
269
Integrations = new Integrations ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
270
+
271
+
238
272
SupplementalData = new SupplementalData ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
273
+
274
+
239
275
Webhooks = new Webhooks ( _defaultClient , _securitySource , _serverUrl , SDKConfiguration ) ;
240
276
}
241
277
}
242
- }
278
+ }
0 commit comments