Skip to content

Commit 0f09780

Browse files
ci: regenerated with OpenAPI Doc 3.0.0, Speakeasy CLI 1.277.6 (#265)
Co-authored-by: speakeasybot <[email protected]>
1 parent 08e84e6 commit 0f09780

File tree

267 files changed

+6183
-3546
lines changed

Some content is hidden

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

267 files changed

+6183
-3546
lines changed

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

Lines changed: 203 additions & 189 deletions
Large diffs are not rendered by default.

sync-for-payroll/CodatSyncPayroll.sln renamed to sync-for-payroll/Codat.Sync.Payroll.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.Payroll", "CodatSyncPayroll\CodatSyncPayroll.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Codat.Sync.Payroll", "Codat\Sync\Payroll\Codat.Sync.Payroll.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
44
EndProject
55

66
Global

sync-for-payroll/Codat/Sync/Payroll/Accounts.cs

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

sync-for-payroll/CodatSyncPayroll/CodatSyncPayroll.csproj renamed to sync-for-payroll/Codat/Sync/Payroll/Codat.Sync.Payroll.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.Payroll</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-payroll/CodatSyncPayroll/CodatSyncPayroll.cs renamed to sync-for-payroll/Codat/Sync/Payroll/CodatSyncPayroll.cs

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

21-
22-
2323
/// <summary>
2424
/// Sync for Payroll: The API for Sync for Payroll. <br/>
2525
///
@@ -31,81 +31,97 @@ namespace Codat.Sync.Payroll
3131
/// <br/>
3232
/// ---<br/>
3333
/// <br/>
34+
/// &lt;!-- Start Codat Tags Table --&gt;<br/>
3435
/// ## Endpoints<br/>
3536
/// <br/>
36-
/// | Endpoints | Description |<br/>
37-
/// |:---------------------|:-----------------------------------------------------------------------------------------------------------|<br/>
38-
/// | Companies | Create and manage your SMB users&apos; companies. |<br/>
39-
/// | Connections | Create new and manage existing data connections for a company. |<br/>
40-
/// | Accounts | Get, create, and update Accounts. |<br/>
41-
/// | Journal entries | Get, create, and update Journal entries. |<br/>
42-
/// | Journals | Get, create, and update Journals. |<br/>
43-
/// | Tracking categories | Get, create, and update Tracking Categories for additional categorization of payroll components. |<br/>
44-
/// | Company info | View company profile from the source platform. |<br/>
45-
/// | Manage data | Control how data is retrieved from an integration. |
37+
/// | Endpoints | Description |<br/>
38+
/// | :- |:- |<br/>
39+
/// | Companies | Create and manage your SMB users&apos; companies. |<br/>
40+
/// | Connections | Create new and manage existing data connections for a company. |<br/>
41+
/// | Accounts | Get, create, and update Accounts. |<br/>
42+
/// | Journal entries | Get, create, and update Journal entries. |<br/>
43+
/// | Journals | Get, create, and update Journals. |<br/>
44+
/// | Tracking categories | Get, create, and update Tracking Categories for additional categorization of payroll components. |<br/>
45+
/// | Company info | View company profile from the source platform. |<br/>
46+
/// | Manage data | Control how data is retrieved from an integration. |<br/>
47+
/// &lt;!-- End Codat Tags Table --&gt;
4648
/// </remarks>
4749
/// </summary>
4850
public interface ICodatSyncPayroll
4951
{
5052

5153
/// <summary>
52-
/// Create and manage your Codat companies.
54+
/// Create and manage your SMB users&apos; companies.
5355
/// </summary>
5456
public ICompanies Companies { get; }
5557

5658
/// <summary>
57-
/// Manage your companies&apos; data connections.
59+
/// Create new and manage existing data connections for a company.
5860
/// </summary>
5961
public IConnections Connections { get; }
6062

6163
/// <summary>
62-
/// Accounts
64+
/// Get, create, and update Accounts.
6365
/// </summary>
6466
public IAccounts Accounts { get; }
6567

6668
/// <summary>
67-
/// Journal entries
69+
/// Get, create, and update Journal entries.
6870
/// </summary>
6971
public IJournalEntries JournalEntries { get; }
7072

7173
/// <summary>
72-
/// Journals
74+
/// Get, create, and update Journals.
7375
/// </summary>
7476
public IJournals Journals { get; }
7577

7678
/// <summary>
77-
/// Asynchronously retrieve data from an integration to refresh data in Codat.
79+
/// Control how data is retrieved from an integration.
7880
/// </summary>
7981
public IManageData ManageData { get; }
8082

8183
/// <summary>
82-
/// View company information fetched from the source platform.
84+
/// View company profile from the source platform.
8385
/// </summary>
8486
public ICompanyInfo CompanyInfo { get; }
8587

8688
/// <summary>
87-
/// Tracking categories
89+
/// Get, create, and update Tracking Categories for additional categorization of payroll components.
8890
/// </summary>
8991
public ITrackingCategories TrackingCategories { get; }
9092
}
91-
93+
9294
public class SDKConfig
9395
{
94-
public static string[] ServerList = new string[]
95-
{
96+
/// <summary>
97+
/// List of server URLs available to the SDK.
98+
/// </summary>
99+
public static readonly string[] ServerList = {
96100
"https://api.codat.io",
97101
};
98-
/// Contains the list of servers available to the SDK
99-
public string serverUrl = "";
100-
public int serverIndex = 0;
101102

102-
public string GetTemplatedServerDetails()
103+
public string ServerUrl = "";
104+
public int ServerIndex = 0;
105+
public SDKHooks hooks = new SDKHooks();
106+
107+
public string GetTemplatedServerUrl()
108+
{
109+
if (!String.IsNullOrEmpty(this.ServerUrl))
110+
{
111+
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.ServerUrl, "/"), new Dictionary<string, string>());
112+
}
113+
return Utilities.TemplateUrl(SDKConfig.ServerList[this.ServerIndex], new Dictionary<string, string>());
114+
}
115+
116+
public ISpeakeasyHttpClient InitHooks(ISpeakeasyHttpClient client)
103117
{
104-
if (!String.IsNullOrEmpty(this.serverUrl))
118+
string preHooksUrl = GetTemplatedServerUrl();
119+
var (postHooksUrl, postHooksClient) = this.hooks.SDKInit(preHooksUrl, client);
120+
if (preHooksUrl != postHooksUrl)
105121
{
106-
return Utilities.TemplateUrl(Utilities.RemoveSuffix(this.serverUrl, "/"), new Dictionary<string, string>());
122+
this.ServerUrl = postHooksUrl;
107123
}
108-
return Utilities.TemplateUrl(SDKConfig.ServerList[this.serverIndex], new Dictionary<string, string>());
124+
return postHooksClient;
109125
}
110126
}
111127

@@ -120,29 +136,31 @@ public string GetTemplatedServerDetails()
120136
/// <br/>
121137
/// ---<br/>
122138
/// <br/>
139+
/// &lt;!-- Start Codat Tags Table --&gt;<br/>
123140
/// ## Endpoints<br/>
124141
/// <br/>
125-
/// | Endpoints | Description |<br/>
126-
/// |:---------------------|:-----------------------------------------------------------------------------------------------------------|<br/>
127-
/// | Companies | Create and manage your SMB users&apos; companies. |<br/>
128-
/// | Connections | Create new and manage existing data connections for a company. |<br/>
129-
/// | Accounts | Get, create, and update Accounts. |<br/>
130-
/// | Journal entries | Get, create, and update Journal entries. |<br/>
131-
/// | Journals | Get, create, and update Journals. |<br/>
132-
/// | Tracking categories | Get, create, and update Tracking Categories for additional categorization of payroll components. |<br/>
133-
/// | Company info | View company profile from the source platform. |<br/>
134-
/// | Manage data | Control how data is retrieved from an integration. |
142+
/// | Endpoints | Description |<br/>
143+
/// | :- |:- |<br/>
144+
/// | Companies | Create and manage your SMB users&apos; companies. |<br/>
145+
/// | Connections | Create new and manage existing data connections for a company. |<br/>
146+
/// | Accounts | Get, create, and update Accounts. |<br/>
147+
/// | Journal entries | Get, create, and update Journal entries. |<br/>
148+
/// | Journals | Get, create, and update Journals. |<br/>
149+
/// | Tracking categories | Get, create, and update Tracking Categories for additional categorization of payroll components. |<br/>
150+
/// | Company info | View company profile from the source platform. |<br/>
151+
/// | Manage data | Control how data is retrieved from an integration. |<br/>
152+
/// &lt;!-- End Codat Tags Table --&gt;
135153
/// </remarks>
136154
/// </summary>
137155
public class CodatSyncPayroll: ICodatSyncPayroll
138156
{
139157
public SDKConfig SDKConfiguration { get; private set; }
140158

141159
private const string _language = "csharp";
142-
private const string _sdkVersion = "3.0.0";
143-
private const string _sdkGenVersion = "2.257.2";
160+
private const string _sdkVersion = "3.1.0";
161+
private const string _sdkGenVersion = "2.319.7";
144162
private const string _openapiDocVersion = "3.0.0";
145-
private const string _userAgent = "speakeasy-sdk/csharp 3.0.0 2.257.2 3.0.0 Codat.Sync.Payroll";
163+
private const string _userAgent = "speakeasy-sdk/csharp 3.1.0 2.319.7 3.0.0 Codat.Sync.Payroll";
146164
private string _serverUrl = "";
147165
private int _serverIndex = 0;
148166
private ISpeakeasyHttpClient _defaultClient;
@@ -160,6 +178,10 @@ public CodatSyncPayroll(Security? security = null, Func<Security>? securitySourc
160178
{
161179
if (serverIndex != null)
162180
{
181+
if (serverIndex.Value < 0 || serverIndex.Value >= SDKConfig.ServerList.Length)
182+
{
183+
throw new Exception($"Invalid server index {serverIndex.Value}");
184+
}
163185
_serverIndex = serverIndex.Value;
164186
}
165187

@@ -182,21 +204,42 @@ public CodatSyncPayroll(Security? security = null, Func<Security>? securitySourc
182204
{
183205
_securitySource = () => security;
184206
}
207+
else
208+
{
209+
throw new Exception("security and securitySource cannot both be null");
210+
}
185211

186212
SDKConfiguration = new SDKConfig()
187213
{
188-
serverIndex = _serverIndex,
189-
serverUrl = _serverUrl
214+
ServerIndex = _serverIndex,
215+
ServerUrl = _serverUrl
190216
};
191217

218+
_defaultClient = SDKConfiguration.InitHooks(_defaultClient);
219+
220+
192221
Companies = new Companies(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
222+
223+
193224
Connections = new Connections(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
225+
226+
194227
Accounts = new Accounts(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
228+
229+
195230
JournalEntries = new JournalEntries(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
231+
232+
196233
Journals = new Journals(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
234+
235+
197236
ManageData = new ManageData(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
237+
238+
198239
CompanyInfo = new CompanyInfo(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
240+
241+
199242
TrackingCategories = new TrackingCategories(_defaultClient, _securitySource, _serverUrl, SDKConfiguration);
200243
}
201244
}
202-
}
245+
}

0 commit comments

Comments
 (0)