Skip to content

Commit

Permalink
🌿 Fern Regeneration -- July 1, 2024 (#18)
Browse files Browse the repository at this point in the history
* SDK regeneration

* fix API types

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: Ben Papillon <benpapillon@gmail.com>
  • Loading branch information
fern-api[bot] and bpapillon committed Jul 1, 2024
1 parent 59823f5 commit 2b69d8a
Show file tree
Hide file tree
Showing 137 changed files with 1,116 additions and 559 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,6 @@ jobs:
- name: Build Release
run: dotnet build src -c Release /p:ContinuousIntegrationBuild=true

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- uses: actions/checkout@master

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.x

- name: Build Release
run: dotnet test src

publish:
needs: [compile]
Expand Down
16 changes: 7 additions & 9 deletions src/SchematicHQ.Client.Test/SchematicHQ.Client.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -10,17 +10,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Moq.Contrib.HttpClient" Version="1.4.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
<PackageReference Include="coverlet.collector" Version="3.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0"/>
<PackageReference Include="NUnit" Version="3.13.3"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2"/>
<PackageReference Include="NUnit.Analyzers" Version="3.6.1"/>
<PackageReference Include="coverlet.collector" Version="3.2.0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SchematicHQ.Client\SchematicHQ.Client.csproj" />
</ItemGroup>

</Project>
</Project>
8 changes: 4 additions & 4 deletions src/SchematicHQ.Client.Test/TestClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public async Task Identify_EnqueuesEventNonBlocking()
var company = new EventBodyIdentifyCompany { Name = "test_company" };

// Act
var identifyTask = Task.Run(() => _schematic.Identify(keys, company, "John Doe", new Dictionary<string, OneOf<string, double, bool, OneOf<string, double, bool>>>()));
var identifyTask = Task.Run(() => _schematic.Identify(keys, company, "John Doe", new Dictionary<string, object>()));

// Assert
await identifyTask; // Ensure the task completes
Expand All @@ -170,7 +170,7 @@ public async Task Track_EnqueuesEventNonBlocking()
var user = new Dictionary<string, string> { { "user_id", "12345" } };

// Act
var trackTask = Task.Run(() => _schematic.Track("event_name", company, user, new Dictionary<string, OneOf<string, double, bool, OneOf<string, double, bool>>>()));
var trackTask = Task.Run(() => _schematic.Track("event_name", company, user, new Dictionary<string, object>()));

// Assert
await trackTask; // Ensure the task completes
Expand Down Expand Up @@ -223,7 +223,7 @@ public void Identify_OfflineMode()
// Act
for (int i = 0; i < 10; i++)
{
_schematic.Identify(keys, company, "John Doe", new Dictionary<string, OneOf<string, double, bool, OneOf<string, double, bool>>>());
_schematic.Identify(keys, company, "John Doe", new Dictionary<string, object>());
}

// Assert
Expand All @@ -247,4 +247,4 @@ public async Task CheckFlag_OfflineModeReturnsDefault()
Assert.That(result, Is.True);
}
}
}
}
20 changes: 10 additions & 10 deletions src/SchematicHQ.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{41730C42-98CA-44C9-97CA-B06F136101CD}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{EBD4CF4C-350D-46AA-A99D-7304014BAF37}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{439AE051-B290-400E-A575-103ACCA138E9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{8412F3CF-8C8C-4A87-A39E-56894D4DAB79}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,13 +16,13 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{41730C42-98CA-44C9-97CA-B06F136101CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41730C42-98CA-44C9-97CA-B06F136101CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41730C42-98CA-44C9-97CA-B06F136101CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41730C42-98CA-44C9-97CA-B06F136101CD}.Release|Any CPU.Build.0 = Release|Any CPU
{439AE051-B290-400E-A575-103ACCA138E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{439AE051-B290-400E-A575-103ACCA138E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{439AE051-B290-400E-A575-103ACCA138E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{439AE051-B290-400E-A575-103ACCA138E9}.Release|Any CPU.Build.0 = Release|Any CPU
{EBD4CF4C-350D-46AA-A99D-7304014BAF37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EBD4CF4C-350D-46AA-A99D-7304014BAF37}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EBD4CF4C-350D-46AA-A99D-7304014BAF37}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EBD4CF4C-350D-46AA-A99D-7304014BAF37}.Release|Any CPU.Build.0 = Release|Any CPU
{8412F3CF-8C8C-4A87-A39E-56894D4DAB79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8412F3CF-8C8C-4A87-A39E-56894D4DAB79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8412F3CF-8C8C-4A87-A39E-56894D4DAB79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8412F3CF-8C8C-4A87-A39E-56894D4DAB79}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
76 changes: 40 additions & 36 deletions src/SchematicHQ.Client/Accounts/AccountsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ public async Task<ListApiKeysResponse> ListApiKeysAsync(ListApiKeysRequest reque
}
if (request.Limit != null)
{
_query["limit"] = request.Limit;
_query["limit"] = request.Limit.ToString();
}
if (request.Offset != null)
{
_query["offset"] = request.Offset;
_query["offset"] = request.Offset.ToString();
}
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = "/api-keys",
Path = "api-keys",
Query = _query
}
);
Expand All @@ -51,10 +51,10 @@ public async Task<ListApiKeysResponse> ListApiKeysAsync(ListApiKeysRequest reque
public async Task<CreateApiKeyResponse> CreateApiKeyAsync(CreateApiKeyRequestBody request)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
Path = "/api-keys",
Path = "api-keys",
Body = request
}
);
Expand All @@ -69,7 +69,7 @@ public async Task<CreateApiKeyResponse> CreateApiKeyAsync(CreateApiKeyRequestBod
public async Task<GetApiKeyResponse> GetApiKeyAsync(string apiKeyId)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/api-keys/{apiKeyId}" }
new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"api-keys/{apiKeyId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
Expand All @@ -85,10 +85,10 @@ UpdateApiKeyRequestBody request
)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
Path = $"/api-keys/{apiKeyId}",
Path = $"api-keys/{apiKeyId}",
Body = request
}
);
Expand All @@ -103,7 +103,11 @@ UpdateApiKeyRequestBody request
public async Task<DeleteApiKeyResponse> DeleteApiKeyAsync(string apiKeyId)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest { Method = HttpMethod.Delete, Path = $"/api-keys/{apiKeyId}" }
new RawClient.JsonApiRequest
{
Method = HttpMethod.Delete,
Path = $"api-keys/{apiKeyId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
Expand All @@ -125,17 +129,17 @@ public async Task<CountApiKeysResponse> CountApiKeysAsync(CountApiKeysRequest re
}
if (request.Limit != null)
{
_query["limit"] = request.Limit;
_query["limit"] = request.Limit.ToString();
}
if (request.Offset != null)
{
_query["offset"] = request.Offset;
_query["offset"] = request.Offset.ToString();
}
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = "/api-keys/count",
Path = "api-keys/count",
Query = _query
}
);
Expand Down Expand Up @@ -164,17 +168,17 @@ public async Task<ListApiRequestsResponse> ListApiRequestsAsync(ListApiRequestsR
}
if (request.Limit != null)
{
_query["limit"] = request.Limit;
_query["limit"] = request.Limit.ToString();
}
if (request.Offset != null)
{
_query["offset"] = request.Offset;
_query["offset"] = request.Offset.ToString();
}
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = "/api-requests",
Path = "api-requests",
Query = _query
}
);
Expand All @@ -189,10 +193,10 @@ public async Task<ListApiRequestsResponse> ListApiRequestsAsync(ListApiRequestsR
public async Task<GetApiRequestResponse> GetApiRequestAsync(string apiRequestId)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = $"/api-requests/{apiRequestId}"
Path = $"api-requests/{apiRequestId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
Expand Down Expand Up @@ -222,17 +226,17 @@ CountApiRequestsRequest request
}
if (request.Limit != null)
{
_query["limit"] = request.Limit;
_query["limit"] = request.Limit.ToString();
}
if (request.Offset != null)
{
_query["offset"] = request.Offset;
_query["offset"] = request.Offset.ToString();
}
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = "/api-requests/count",
Path = "api-requests/count",
Query = _query
}
);
Expand All @@ -255,17 +259,17 @@ ListEnvironmentsRequest request
}
if (request.Limit != null)
{
_query["limit"] = request.Limit;
_query["limit"] = request.Limit.ToString();
}
if (request.Offset != null)
{
_query["offset"] = request.Offset;
_query["offset"] = request.Offset.ToString();
}
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = "/environments",
Path = "environments",
Query = _query
}
);
Expand All @@ -282,10 +286,10 @@ CreateEnvironmentRequestBody request
)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
Path = "/environments",
Path = "environments",
Body = request
}
);
Expand All @@ -300,10 +304,10 @@ CreateEnvironmentRequestBody request
public async Task<GetEnvironmentResponse> GetEnvironmentAsync(string environmentId)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
Path = $"/environments/{environmentId}"
Path = $"environments/{environmentId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
Expand All @@ -320,10 +324,10 @@ UpdateEnvironmentRequestBody request
)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
Path = $"/environments/{environmentId}",
Path = $"environments/{environmentId}",
Body = request
}
);
Expand All @@ -338,10 +342,10 @@ UpdateEnvironmentRequestBody request
public async Task<DeleteEnvironmentResponse> DeleteEnvironmentAsync(string environmentId)
{
var response = await _client.MakeRequestAsync(
new RawClient.ApiRequest
new RawClient.JsonApiRequest
{
Method = HttpMethod.Delete,
Path = $"/environments/{environmentId}"
Path = $"environments/{environmentId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ListApiKeysResponse
/// The returned resources
/// </summary>
[JsonPropertyName("data")]
public List<ApiKeyResponseData> Data { get; init; }
public IEnumerable<ApiKeyResponseData> Data { get; init; }

/// <summary>
/// Input parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ListApiRequestsResponse
/// The returned resources
/// </summary>
[JsonPropertyName("data")]
public List<ApiKeyRequestListResponseData> Data { get; init; }
public IEnumerable<ApiKeyRequestListResponseData> Data { get; init; }

/// <summary>
/// Input parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class ListEnvironmentsParams
{
[JsonPropertyName("ids")]
public List<string>? Ids { get; init; }
public IEnumerable<string>? Ids { get; init; }

/// <summary>
/// Page limit (default 100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ListEnvironmentsResponse
/// The returned resources
/// </summary>
[JsonPropertyName("data")]
public List<EnvironmentResponseData> Data { get; init; }
public IEnumerable<EnvironmentResponseData> Data { get; init; }

/// <summary>
/// Input parameters
Expand Down
Loading

0 comments on commit 2b69d8a

Please sign in to comment.