Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 3.0.0, Speakeay CLI 1.77.1 (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
  • Loading branch information
github-actions[bot] and speakeasybot committed Sep 1, 2023
1 parent cc090cb commit 182f2b6
Show file tree
Hide file tree
Showing 176 changed files with 9,172 additions and 7 deletions.
2 changes: 2 additions & 0 deletions bank-feeds/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This allows generated code to be indexed correctly
*.cs linguist-generated=false
3 changes: 3 additions & 0 deletions bank-feeds/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
obj/
bin/
debug/
17 changes: 17 additions & 0 deletions bank-feeds/CodatBankFeeds.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodatBankFeeds", "CodatBankFeeds\CodatBankFeeds.csproj", "{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}"
EndProject

Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0CE92B5-F3CC-45A2-AA83-118C38724EB1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
173 changes: 173 additions & 0 deletions bank-feeds/CodatBankFeeds/AccountMapping.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace CodatBankFeeds
{
using CodatBankFeeds.Models.Operations;
using CodatBankFeeds.Models.Shared;
using CodatBankFeeds.Utils;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System;

public interface IAccountMappingSDK
{
Task<CreateBankAccountMappingResponse> CreateAsync(CreateBankAccountMappingRequest? request = null);
Task<GetBankAccountMappingResponse> GetAsync(GetBankAccountMappingRequest? request = null);
}

public class AccountMappingSDK: IAccountMappingSDK
{
public SDKConfig Config { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.0";
private const string _sdkGenVersion = "2.91.4";
private const string _openapiDocVersion = "3.0.0";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

public AccountMappingSDK(ISpeakeasyHttpClient defaultClient, ISpeakeasyHttpClient securityClient, string serverUrl, SDKConfig config)
{
_defaultClient = defaultClient;
_securityClient = securityClient;
_serverUrl = serverUrl;
Config = config;
}


/// <summary>
/// Create bank feed bank account mapping
///
/// <remarks>
/// The *Create bank account mapping* endpoint creates a new mapping between a source bank account and a potential account in the accounting platform (target account).
///
/// A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end users account in the underlying platform).
///
/// To find valid target account options, first call list bank feed account mappings.
///
/// This endpoint is only needed if building an account management UI.
/// </remarks>
/// </summary>
public async Task<CreateBankAccountMappingResponse> CreateAsync(CreateBankAccountMappingRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Post, urlString);
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");

var serializedBody = RequestBodySerializer.Serialize(request, "BankFeedAccountMapping", "json");
if (serializedBody != null)
{
httpRequest.Content = serializedBody;
}

var client = _securityClient;

var httpResponse = await client.SendAsync(httpRequest);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;

var response = new CreateBankAccountMappingResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.BankFeedAccountMappingResponse = JsonConvert.DeserializeObject<BankFeedAccountMappingResponse>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
if((response.StatusCode == 400) || (response.StatusCode == 401) || (response.StatusCode == 404) || (response.StatusCode == 429))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}


/// <summary>
/// List bank feed account mappings
///
/// <remarks>
/// The *List bank account mappings* endpoint returns information about a source bank account and any current or potential target mapping accounts.
///
/// A bank feed account mapping is a specified link between the source account (provided by the Codat user) and the target account (the end users account in the underlying platform).
///
/// This endpoint is only needed if building an account management UI.
/// </remarks>
/// </summary>
public async Task<GetBankAccountMappingResponse> GetAsync(GetBankAccountMappingRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies/{companyId}/connections/{connectionId}/bankFeedAccounts/mapping", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Get, urlString);
httpRequest.Headers.Add("user-agent", $"speakeasy-sdk/{_language} {_sdkVersion} {_sdkGenVersion} {_openapiDocVersion}");


var client = _securityClient;

var httpResponse = await client.SendAsync(httpRequest);

var contentType = httpResponse.Content.Headers.ContentType?.MediaType;

var response = new GetBankAccountMappingResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.BankFeedMapping = JsonConvert.DeserializeObject<BankFeedMapping>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
if((response.StatusCode == 401) || (response.StatusCode == 429))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.ErrorMessage = JsonConvert.DeserializeObject<ErrorMessage>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}

}
}
19 changes: 19 additions & 0 deletions bank-feeds/CodatBankFeeds/CodatBankFeeds.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>Codat.BankFeeds</PackageId>
<Version>0.1.0</Version>
<Authors>Codat</Authors>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="../README.md" Pack="true" PackagePath="/"/>
<None Include="../docs/*" Pack="true" PackagePath="/docs"/>

<PackageReference Include="newtonsoft.json" Version="13.0.3" />
<PackageReference Include="nodatime" Version="3.1.9" />
</ItemGroup>
</Project>
77 changes: 77 additions & 0 deletions bank-feeds/CodatBankFeeds/CodatBankFeedsSDK.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
//
// Changes to this file may cause incorrect behavior and will be lost when
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#nullable enable
namespace CodatBankFeeds
{
using CodatBankFeeds.Models.Shared;
using CodatBankFeeds.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using System;

public interface ICodatBankFeedsSDK
{
public IAccountMappingSDK AccountMapping { get; }
public ICompaniesSDK Companies { get; }
public IConnectionsSDK Connections { get; }
public ISourceAccountsSDK SourceAccounts { get; }
public ITransactionsSDK Transactions { get; }
}

public class SDKConfig
{
}

public class CodatBankFeedsSDK: ICodatBankFeedsSDK
{
public SDKConfig Config { get; private set; }
public static List<string> ServerList = new List<string>()
{
"https://api.codat.io",
};

private const string _language = "csharp";
private const string _sdkVersion = "0.1.0";
private const string _sdkGenVersion = "2.91.4";
private const string _openapiDocVersion = "3.0.0";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public IAccountMappingSDK AccountMapping { get; private set; }
public ICompaniesSDK Companies { get; private set; }
public IConnectionsSDK Connections { get; private set; }
public ISourceAccountsSDK SourceAccounts { get; private set; }
public ITransactionsSDK Transactions { get; private set; }

public CodatBankFeedsSDK(Security? security = null, string? serverUrl = null, ISpeakeasyHttpClient? client = null)
{
_serverUrl = serverUrl ?? CodatBankFeedsSDK.ServerList[0];

_defaultClient = new SpeakeasyHttpClient(client);
_securityClient = _defaultClient;

if(security != null)
{
_securityClient = SecuritySerializer.Apply(_defaultClient, security);
}

Config = new SDKConfig()
{
};

AccountMapping = new AccountMappingSDK(_defaultClient, _securityClient, _serverUrl, Config);
Companies = new CompaniesSDK(_defaultClient, _securityClient, _serverUrl, Config);
Connections = new ConnectionsSDK(_defaultClient, _securityClient, _serverUrl, Config);
SourceAccounts = new SourceAccountsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Transactions = new TransactionsSDK(_defaultClient, _securityClient, _serverUrl, Config);
}
}
}
Loading

0 comments on commit 182f2b6

Please sign in to comment.