@@ -31,7 +31,7 @@ public interface IConnectionsSDK
31
31
/// <remarks>
32
32
/// Creates a connection for the company by providing a valid `platformKey`. <br/>
33
33
/// <br/>
34
- /// Use the <a href="https://docs.codat.io/sync-for-commerce-api#/operations/list-integrations">List Integrations</a> endpoint to access valid platform keys.
34
+ /// Use the <a href="https://docs.codat.io/sync-for-sync-for- commerce-api#/operations/list-integrations">List Integrations</a> endpoint to access valid platform keys.
35
35
/// </remarks>
36
36
/// </summary>
37
37
Task < CreateConnectionResponse > CreateAsync ( CreateConnectionRequest ? request = null ) ;
@@ -80,9 +80,10 @@ public class ConnectionsSDK: IConnectionsSDK
80
80
{
81
81
public SDKConfig Config { get ; private set ; }
82
82
private const string _language = "csharp" ;
83
- private const string _sdkVersion = "2.1 .0" ;
84
- private const string _sdkGenVersion = "2.129.1 " ;
83
+ private const string _sdkVersion = "2.2 .0" ;
84
+ private const string _sdkGenVersion = "2.159.2 " ;
85
85
private const string _openapiDocVersion = "1.1" ;
86
+ private const string _userAgent = "speakeasy-sdk/csharp 2.2.0 2.159.2 1.1 Codat.Sync.Commerce" ;
86
87
private string _serverUrl = "" ;
87
88
private ISpeakeasyHttpClient _defaultClient ;
88
89
private ISpeakeasyHttpClient _securityClient ;
@@ -107,7 +108,7 @@ public async Task<CreateConnectionResponse> CreateAsync(CreateConnectionRequest?
107
108
108
109
109
110
var httpRequest = new HttpRequestMessage ( HttpMethod . Post , urlString ) ;
110
- httpRequest . Headers . Add ( "user-agent" , $ "speakeasy-sdk/ { _language } { _sdkVersion } { _sdkGenVersion } { _openapiDocVersion } " ) ;
111
+ httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
111
112
112
113
var serializedBody = RequestBodySerializer . Serialize ( request , "RequestBody" , "json" ) ;
113
114
if ( serializedBody != null )
@@ -127,9 +128,10 @@ public async Task<CreateConnectionResponse> CreateAsync(CreateConnectionRequest?
127
128
ContentType = contentType ,
128
129
RawResponse = httpResponse
129
130
} ;
131
+
130
132
if ( ( response . StatusCode == 200 ) )
131
133
{
132
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
134
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
133
135
{
134
136
response . Connection = JsonConvert . DeserializeObject < Connection > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
135
137
}
@@ -138,7 +140,7 @@ public async Task<CreateConnectionResponse> CreateAsync(CreateConnectionRequest?
138
140
}
139
141
if ( ( response . StatusCode == 401 ) || ( response . StatusCode == 404 ) || ( response . StatusCode == 429 ) )
140
142
{
141
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
143
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
142
144
{
143
145
response . ErrorMessage = JsonConvert . DeserializeObject < ErrorMessage > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
144
146
}
@@ -160,7 +162,7 @@ public async Task<GetSyncFlowUrlResponse> GetSyncFlowUrlAsync(GetSyncFlowUrlRequ
160
162
161
163
162
164
var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
163
- httpRequest . Headers . Add ( "user-agent" , $ "speakeasy-sdk/ { _language } { _sdkVersion } { _sdkGenVersion } { _openapiDocVersion } " ) ;
165
+ httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
164
166
165
167
166
168
var client = _securityClient ;
@@ -175,9 +177,10 @@ public async Task<GetSyncFlowUrlResponse> GetSyncFlowUrlAsync(GetSyncFlowUrlRequ
175
177
ContentType = contentType ,
176
178
RawResponse = httpResponse
177
179
} ;
180
+
178
181
if ( ( response . StatusCode == 200 ) )
179
182
{
180
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
183
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
181
184
{
182
185
response . SyncFlowUrl = JsonConvert . DeserializeObject < SyncFlowUrl > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
183
186
}
@@ -199,7 +202,7 @@ public async Task<ListConnectionsResponse> ListAsync(ListConnectionsRequest? req
199
202
200
203
201
204
var httpRequest = new HttpRequestMessage ( HttpMethod . Get , urlString ) ;
202
- httpRequest . Headers . Add ( "user-agent" , $ "speakeasy-sdk/ { _language } { _sdkVersion } { _sdkGenVersion } { _openapiDocVersion } " ) ;
205
+ httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
203
206
204
207
205
208
var client = _securityClient ;
@@ -214,9 +217,10 @@ public async Task<ListConnectionsResponse> ListAsync(ListConnectionsRequest? req
214
217
ContentType = contentType ,
215
218
RawResponse = httpResponse
216
219
} ;
220
+
217
221
if ( ( response . StatusCode == 200 ) )
218
222
{
219
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
223
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
220
224
{
221
225
response . Connections = JsonConvert . DeserializeObject < Connections > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
222
226
}
@@ -225,7 +229,7 @@ public async Task<ListConnectionsResponse> ListAsync(ListConnectionsRequest? req
225
229
}
226
230
if ( ( response . StatusCode == 400 ) || ( response . StatusCode == 401 ) || ( response . StatusCode == 404 ) || ( response . StatusCode == 429 ) )
227
231
{
228
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
232
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
229
233
{
230
234
response . ErrorMessage = JsonConvert . DeserializeObject < ErrorMessage > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
231
235
}
@@ -247,7 +251,7 @@ public async Task<UpdateConnectionAuthorizationResponse> UpdateAuthorizationAsyn
247
251
248
252
249
253
var httpRequest = new HttpRequestMessage ( HttpMethod . Put , urlString ) ;
250
- httpRequest . Headers . Add ( "user-agent" , $ "speakeasy-sdk/ { _language } { _sdkVersion } { _sdkGenVersion } { _openapiDocVersion } " ) ;
254
+ httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
251
255
252
256
var serializedBody = RequestBodySerializer . Serialize ( request , "RequestBody" , "json" ) ;
253
257
if ( serializedBody != null )
@@ -267,9 +271,10 @@ public async Task<UpdateConnectionAuthorizationResponse> UpdateAuthorizationAsyn
267
271
ContentType = contentType ,
268
272
RawResponse = httpResponse
269
273
} ;
274
+
270
275
if ( ( response . StatusCode == 200 ) )
271
276
{
272
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
277
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
273
278
{
274
279
response . Connection = JsonConvert . DeserializeObject < Connection > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
275
280
}
@@ -291,7 +296,7 @@ public async Task<UpdateConnectionResponse> UpdateConnectionAsync(UpdateConnecti
291
296
292
297
293
298
var httpRequest = new HttpRequestMessage ( HttpMethod . Patch , urlString ) ;
294
- httpRequest . Headers . Add ( "user-agent" , $ "speakeasy-sdk/ { _language } { _sdkVersion } { _sdkGenVersion } { _openapiDocVersion } " ) ;
299
+ httpRequest . Headers . Add ( "user-agent" , _userAgent ) ;
295
300
296
301
var serializedBody = RequestBodySerializer . Serialize ( request , "UpdateConnection" , "json" ) ;
297
302
if ( serializedBody != null )
@@ -311,9 +316,10 @@ public async Task<UpdateConnectionResponse> UpdateConnectionAsync(UpdateConnecti
311
316
ContentType = contentType ,
312
317
RawResponse = httpResponse
313
318
} ;
319
+
314
320
if ( ( response . StatusCode == 200 ) )
315
321
{
316
- if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
322
+ if ( Utilities . IsContentTypeMatch ( "application/json" , response . ContentType ) )
317
323
{
318
324
response . Connection = JsonConvert . DeserializeObject < Connection > ( await httpResponse . Content . ReadAsStringAsync ( ) , new JsonSerializerSettings ( ) { NullValueHandling = NullValueHandling . Ignore , Converters = new JsonConverter [ ] { new FlexibleObjectDeserializer ( ) , new EnumSerializer ( ) } } ) ;
319
325
}
0 commit comments