Skip to content

Commit ae18671

Browse files
ci: regenerated with OpenAPI Doc 1.1, Speakeasy CLI 1.277.6 (#268)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
1 parent 39cf4d3 commit ae18671

File tree

208 files changed

+4378
-2357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+4378
-2357
lines changed

sync-for-commerce/.speakeasy/gen.lock

Lines changed: 162 additions & 143 deletions
Large diffs are not rendered by default.

sync-for-commerce/CodatSyncCommerce.sln renamed to sync-for-commerce/Codat.Sync.Commerce.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Codat.Sync.Commerce", "CodatSyncCommerce\CodatSyncCommerce.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Codat.Sync.Commerce", "Codat\Sync\Commerce\Codat.Sync.Commerce.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
44
EndProject
55

66
Global

sync-for-commerce/Codat/Sync/Commerce/AdvancedControls.cs

Lines changed: 454 additions & 0 deletions
Large diffs are not rendered by default.

sync-for-commerce/CodatSyncCommerce/CodatSyncCommerce.csproj renamed to sync-for-commerce/Codat/Sync/Commerce/Codat.Sync.Commerce.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<IsPackable>true</IsPackable>
44
<PackageId>Codat.Sync.Commerce</PackageId>
5-
<Version>3.0.0</Version>
5+
<Version>3.1.0</Version>
66
<Authors>Codat</Authors>
77
<TargetFramework>net6.0</TargetFramework>
88
<Nullable>enable</Nullable>

sync-for-commerce/CodatSyncCommerce/CodatSyncCommerce.cs renamed to sync-for-commerce/Codat/Sync/Commerce/CodatSyncCommerce.cs

Lines changed: 88 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#nullable enable
1111
namespace Codat.Sync.Commerce
1212
{
13+
using Codat.Sync.Commerce.Hooks;
14+
using Codat.Sync.Commerce.Models.Errors;
1315
using Codat.Sync.Commerce.Models.Shared;
1416
using Codat.Sync.Commerce.Utils;
1517
using Newtonsoft.Json;
@@ -18,66 +20,92 @@ namespace Codat.Sync.Commerce
1820
using System.Threading.Tasks;
1921
using System;
2022

21-
22-
2323
/// <summary>
2424
/// Sync for Commerce: The API for Sync for Commerce. <br/>
2525
///
2626
/// <remarks>
2727
/// <br/>
2828
/// Sync for Commerce automatically replicates and reconciles sales data from a merchant’s source PoS, Payments, and eCommerce systems into their accounting software. This eliminates manual processing by merchants and transforms their ability to run and grow their business.<br/>
2929
/// <br/>
30-
/// <a href="https://docs.codat.io/commerce/overview">Read More...</a><br/>
30+
/// <a href="https://docs.codat.io/commerce/overview">Explore product</a> | <a href="https://github.com/codatio/oas">See our OpenAPI spec</a><br/>
31+
/// <br/>
32+
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-commerce-v1-api#/">different version of Sync for Commerce</a>.<br/>
33+
/// <br/>
34+
/// ---<br/>
3135
/// <br/>
32-
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-commerce-v1-api#/">different version of Sync for Commerce</a>.
36+
/// &lt;!-- Start Codat Tags Table --&gt;<br/>
37+
/// ## Endpoints<br/>
38+
/// <br/>
39+
/// | Endpoints | Description |<br/>
40+
/// | :- |:- |<br/>
41+
/// | Connections | Create new and manage existing data connections for a company. |<br/>
42+
/// | Sync | Initiate data syncs and monitor their status. |<br/>
43+
/// | Sync flow settings | Control text and visibility settings for the Sync Flow. |<br/>
44+
/// | Integrations | Get a list of integrations supported by Sync for Commerce and their logos. |<br/>
45+
/// | Advanced controls | View and manage mapping configured for a company&apos;s commerce sync. |<br/>
46+
/// &lt;!-- End Codat Tags Table --&gt;
3347
/// </remarks>
3448
/// </summary>
3549
public interface ICodatSyncCommerce
3650
{
3751

3852
/// <summary>
39-
/// Configure preferences for any given Sync for Commerce company using sync flow.
53+
/// Control text and visibility settings for the Sync Flow.
4054
/// </summary>
4155
public ISyncFlowSettings SyncFlowSettings { get; }
4256

4357
/// <summary>
44-
/// Advanced company management and sync preferences.
58+
/// View and manage mapping configured for a company&apos;s commerce sync.
4559
/// </summary>
4660
public IAdvancedControls AdvancedControls { get; }
4761

4862
/// <summary>
49-
/// Create new and manage existing Sync for Commerce connections using the Sync flow UI.
63+
/// Create new and manage existing data connections for a company.
5064
/// </summary>
5165
public IConnections Connections { get; }
5266

5367
/// <summary>
54-
/// Initiate and monitor the sync of company data into accounting software.
68+
/// Initiate data syncs and monitor their status.
5569
/// </summary>
5670
public ISync Sync { get; }
5771

5872
/// <summary>
59-
/// View useful information about codat&apos;s integrations.
73+
/// Get a list of integrations supported by Sync for Commerce and their logos.
6074
/// </summary>
6175
public IIntegrations Integrations { get; }
6276
}
63-
77+
6478
public class SDKConfig
6579
{
66-
public static string[] ServerList = new string[]
67-
{
80+
/// <summary>
81+
/// List of server URLs available to the SDK.
82+
/// </summary>
83+
public static readonly string[] ServerList = {
6884
"https://api.codat.io",
6985
};
70-
/// Contains the list of servers available to the SDK
71-
public string serverUrl = "";
72-
public int serverIndex = 0;
7386

74-
public string GetTemplatedServerDetails()
87+
public string ServerUrl = "";
88+
public int ServerIndex = 0;
89+
public SDKHooks hooks = new SDKHooks();
90+
91+
public string GetTemplatedServerUrl()
92+
{
93+
if (!String.IsNullOrEmpty(this.ServerUrl))
94+
{
95+
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
96+
}
97+
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary<string, string>());
98+
}
99+
100+
public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client)
75101
{
76-
if (!String.IsNullOrEmpty(this.serverUrl))
102+
string preHooksUrl = GetTemplatedServerUrl();
103+
var (postHooksUrl, postHooksClient) = this.hooks.SDKInit(preHooksUrl, client);
104+
if (preHooksUrl != postHooksUrl)
77105
{
78-
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.serverUrl, "/"), new Dictionary<string, string>());
106+
this.ServerUrl = postHooksUrl;
79107
}
80-
return Utilities.TemplateUrl(SDKConfig.ServerList[this.serverIndex], new Dictionary<string, string>());
108+
return postHooksClient;
81109
}
82110
}
83111

@@ -88,20 +116,34 @@ public string GetTemplatedServerDetails()
88116
/// <br/>
89117
/// Sync for Commerce automatically replicates and reconciles sales data from a merchant’s source PoS, Payments, and eCommerce systems into their accounting software. This eliminates manual processing by merchants and transforms their ability to run and grow their business.<br/>
90118
/// <br/>
91-
/// <a href="https://docs.codat.io/commerce/overview">Read More...</a><br/>
119+
/// <a href="https://docs.codat.io/commerce/overview">Explore product</a> | <a href="https://github.com/codatio/oas">See our OpenAPI spec</a><br/>
120+
/// <br/>
121+
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-commerce-v1-api#/">different version of Sync for Commerce</a>.<br/>
92122
/// <br/>
93-
/// Not seeing the endpoints you&apos;re expecting? We&apos;ve <a href="https://docs.codat.io/updates/230901-new-products">reorganized our products</a>, and you may be using a <a href="https://docs.codat.io/sync-for-commerce-v1-api#/">different version of Sync for Commerce</a>.
123+
/// ---<br/>
124+
/// <br/>
125+
/// &lt;!-- Start Codat Tags Table --&gt;<br/>
126+
/// ## Endpoints<br/>
127+
/// <br/>
128+
/// | Endpoints | Description |<br/>
129+
/// | :- |:- |<br/>
130+
/// | Connections | Create new and manage existing data connections for a company. |<br/>
131+
/// | Sync | Initiate data syncs and monitor their status. |<br/>
132+
/// | Sync flow settings | Control text and visibility settings for the Sync Flow. |<br/>
133+
/// | Integrations | Get a list of integrations supported by Sync for Commerce and their logos. |<br/>
134+
/// | Advanced controls | View and manage mapping configured for a company&apos;s commerce sync. |<br/>
135+
/// &lt;!-- End Codat Tags Table --&gt;
94136
/// </remarks>
95137
/// </summary>
96138
public class CodatSyncCommerce: ICodatSyncCommerce
97139
{
98140
public SDKConfig SDKConfiguration { get; private set; }
99141

100142
private const string _language = "csharp";
101-
private const string _sdkVersion = "3.0.0";
102-
private const string _sdkGenVersion = "2.257.2";
143+
private const string _sdkVersion = "3.1.0";
144+
private const string _sdkGenVersion = "2.319.7";
103145
private const string _openapiDocVersion = "1.1";
104-
private const string _userAgent = "speakeasy-sdk/csharp 3.0.0 2.257.2 1.1 Codat.Sync.Commerce";
146+
private const string _userAgent = "speakeasy-sdk/csharp 3.1.0 2.319.7 1.1 Codat.Sync.Commerce";
105147
private string _serverUrl = "";
106148
private int _serverIndex = 0;
107149
private ISpeakeasyHttpClient _defaultClient;
@@ -116,6 +158,10 @@ public CodatSyncCommerce(Security? security = null, Func<Security>? securitySour
116158
{
117159
if (serverIndex != null)
118160
{
161+
if (serverIndex.Value < 0 || serverIndex.Value >= SDKConfig.ServerList.Length)
162+
{
163+
throw new Exception($"Invalid server index {serverIndex.Value}");
164+
}
119165
_serverIndex = serverIndex.Value;
120166
}
121167

@@ -138,18 +184,33 @@ public CodatSyncCommerce(Security? security = null, Func<Security>? securitySour
138184
{
139185
_securitySource = () => security;
140186
}
187+
else
188+
{
189+
throw new Exception("security and securitySource cannot both be null");
190+
}
141191

142192
SDKConfiguration = new SDKConfig()
143193
{
144-
serverIndex = _serverIndex,
145-
serverUrl = _serverUrl
194+
ServerIndex = _serverIndex,
195+
ServerUrl = _serverUrl
146196
};
147197

198+
_defaultClient = SDKConfiguration.InitHooks(_defaultClient);
199+
200+
148201
SyncFlowSettings = new SyncFlowSettings(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
202+
203+
149204
AdvancedControls = new AdvancedControls(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
205+
206+
150207
Connections = new Connections(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
208+
209+
151210
Sync = new Sync(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
211+
212+
152213
Integrations = new Integrations(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
153214
}
154215
}
155-
}
216+
}

0 commit comments

Comments
 (0)