Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.1, Speakeay CLI 1.77.0 (#8)
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 authored Sep 1, 2023
1 parent 8b40344 commit 9bae03a
Show file tree
Hide file tree
Showing 222 changed files with 9,751 additions and 7 deletions.
2 changes: 2 additions & 0 deletions sync-for-commerce/.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 sync-for-commerce/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
obj/
bin/
debug/
17 changes: 17 additions & 0 deletions sync-for-commerce/CodatSyncCommerce.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}") = "CodatSyncCommerce", "CodatSyncCommerce\CodatSyncCommerce.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
239 changes: 239 additions & 0 deletions sync-for-commerce/CodatSyncCommerce/AdvancedControls.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@

//------------------------------------------------------------------------------
// <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 CodatSyncCommerce
{
using CodatSyncCommerce.Models.Operations;
using CodatSyncCommerce.Models.Shared;
using CodatSyncCommerce.Utils;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Net.Http;
using System.Threading.Tasks;
using System;

public interface IAdvancedControlsSDK
{
Task<CreateCompanyResponse> CreateCompanyAsync(CreateCompany? request = null);
Task<GetConfigurationResponse> GetConfigurationAsync(GetConfigurationRequest? request = null);
Task<ListCompaniesResponse> ListCompaniesAsync(ListCompaniesRequest? request = null);
Task<SetConfigurationResponse> SetConfigurationAsync(SetConfigurationRequest? request = null);
}

public class AdvancedControlsSDK: IAdvancedControlsSDK
{
public SDKConfig Config { get; private set; }
private const string _language = "csharp";
private const string _sdkVersion = "0.1.0";
private const string _sdkGenVersion = "2.91.2";
private const string _openapiDocVersion = "1.1";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;

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


/// <summary>
/// Create company
///
/// <remarks>
/// Creates a Codat company..
/// </remarks>
/// </summary>
public async Task<CreateCompanyResponse> CreateCompanyAsync(CreateCompany? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = baseUrl + "/companies";


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

var serializedBody = RequestBodySerializer.Serialize(request, "Request", "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 CreateCompanyResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.Company = JsonConvert.DeserializeObject<Company>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}


/// <summary>
/// Get company configuration
///
/// <remarks>
/// Returns a company's commerce sync configuration'.
/// </remarks>
/// </summary>
public async Task<GetConfigurationResponse> GetConfigurationAsync(GetConfigurationRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/config/companies/{companyId}/sync/commerce", 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 GetConfigurationResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.Configuration = JsonConvert.DeserializeObject<Configuration>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}


/// <summary>
/// List companies
///
/// <remarks>
/// Returns a list of companies.
/// </remarks>
/// </summary>
public async Task<ListCompaniesResponse> ListCompaniesAsync(ListCompaniesRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/companies", 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 ListCompaniesResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.Companies = JsonConvert.DeserializeObject<Companies>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}


/// <summary>
/// Set configuration
///
/// <remarks>
/// Sets a company's commerce sync configuration.
/// </remarks>
/// </summary>
public async Task<SetConfigurationResponse> SetConfigurationAsync(SetConfigurationRequest? request = null)
{
string baseUrl = _serverUrl;
if (baseUrl.EndsWith("/"))
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
var urlString = URLBuilder.Build(baseUrl, "/config/companies/{companyId}/sync/commerce", request);


var httpRequest = new HttpRequestMessage(HttpMethod.Post, 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 SetConfigurationResponse
{
StatusCode = (int)httpResponse.StatusCode,
ContentType = contentType,
RawResponse = httpResponse
};
if((response.StatusCode == 200))
{
if(Utilities.IsContentTypeMatch("application/json",response.ContentType))
{
response.Configuration = JsonConvert.DeserializeObject<Configuration>(await httpResponse.Content.ReadAsStringAsync(), new JsonSerializerSettings(){ NullValueHandling = NullValueHandling.Ignore, Converters = new JsonConverter[] { new FlexibleObjectDeserializer() }});
}

return response;
}
return response;
}

}
}
19 changes: 19 additions & 0 deletions sync-for-commerce/CodatSyncCommerce/CodatSyncCommerce.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.Sync.Commerce</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 sync-for-commerce/CodatSyncCommerce/CodatSyncCommerceSDK.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 CodatSyncCommerce
{
using CodatSyncCommerce.Models.Shared;
using CodatSyncCommerce.Utils;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using System;

public interface ICodatSyncCommerceSDK
{
public IAdvancedControlsSDK AdvancedControls { get; }
public IConnectionsSDK Connections { get; }
public IIntegrationsSDK Integrations { get; }
public ISyncSDK Sync { get; }
public ISyncFlowPreferencesSDK SyncFlowPreferences { get; }
}

public class SDKConfig
{
}

public class CodatSyncCommerceSDK: ICodatSyncCommerceSDK
{
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.2";
private const string _openapiDocVersion = "1.1";
private string _serverUrl = "";
private ISpeakeasyHttpClient _defaultClient;
private ISpeakeasyHttpClient _securityClient;
public IAdvancedControlsSDK AdvancedControls { get; private set; }
public IConnectionsSDK Connections { get; private set; }
public IIntegrationsSDK Integrations { get; private set; }
public ISyncSDK Sync { get; private set; }
public ISyncFlowPreferencesSDK SyncFlowPreferences { get; private set; }

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

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

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

Config = new SDKConfig()
{
};

AdvancedControls = new AdvancedControlsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Connections = new ConnectionsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Integrations = new IntegrationsSDK(_defaultClient, _securityClient, _serverUrl, Config);
Sync = new SyncSDK(_defaultClient, _securityClient, _serverUrl, Config);
SyncFlowPreferences = new SyncFlowPreferencesSDK(_defaultClient, _securityClient, _serverUrl, Config);
}
}
}
Loading

0 comments on commit 9bae03a

Please sign in to comment.