diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 23c152b..ac82e8c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -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]
diff --git a/src/SchematicHQ.Client.Test/SchematicHQ.Client.Test.csproj b/src/SchematicHQ.Client.Test/SchematicHQ.Client.Test.csproj
index bfe53df..4241ce0 100644
--- a/src/SchematicHQ.Client.Test/SchematicHQ.Client.Test.csproj
+++ b/src/SchematicHQ.Client.Test/SchematicHQ.Client.Test.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net7.0
enable
enable
@@ -10,17 +10,15 @@
-
-
-
-
-
-
-
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/SchematicHQ.Client.Test/TestClient.cs b/src/SchematicHQ.Client.Test/TestClient.cs
index 2ca2fed..fb88bfc 100644
--- a/src/SchematicHQ.Client.Test/TestClient.cs
+++ b/src/SchematicHQ.Client.Test/TestClient.cs
@@ -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>>()));
+ var identifyTask = Task.Run(() => _schematic.Identify(keys, company, "John Doe", new Dictionary()));
// Assert
await identifyTask; // Ensure the task completes
@@ -170,7 +170,7 @@ public async Task Track_EnqueuesEventNonBlocking()
var user = new Dictionary { { "user_id", "12345" } };
// Act
- var trackTask = Task.Run(() => _schematic.Track("event_name", company, user, new Dictionary>>()));
+ var trackTask = Task.Run(() => _schematic.Track("event_name", company, user, new Dictionary()));
// Assert
await trackTask; // Ensure the task completes
@@ -223,7 +223,7 @@ public void Identify_OfflineMode()
// Act
for (int i = 0; i < 10; i++)
{
- _schematic.Identify(keys, company, "John Doe", new Dictionary>>());
+ _schematic.Identify(keys, company, "John Doe", new Dictionary());
}
// Assert
@@ -247,4 +247,4 @@ public async Task CheckFlag_OfflineModeReturnsDefault()
Assert.That(result, Is.True);
}
}
-}
\ No newline at end of file
+}
diff --git a/src/SchematicHQ.Client.sln b/src/SchematicHQ.Client.sln
index 432cb43..0c93b5d 100644
--- a/src/SchematicHQ.Client.sln
+++ b/src/SchematicHQ.Client.sln
@@ -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
@@ -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
diff --git a/src/SchematicHQ.Client/Accounts/AccountsClient.cs b/src/SchematicHQ.Client/Accounts/AccountsClient.cs
index 9bdb911..00f323d 100644
--- a/src/SchematicHQ.Client/Accounts/AccountsClient.cs
+++ b/src/SchematicHQ.Client/Accounts/AccountsClient.cs
@@ -26,17 +26,17 @@ public async Task 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
}
);
@@ -51,10 +51,10 @@ public async Task ListApiKeysAsync(ListApiKeysRequest reque
public async Task 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
}
);
@@ -69,7 +69,7 @@ public async Task CreateApiKeyAsync(CreateApiKeyRequestBod
public async Task 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)
@@ -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
}
);
@@ -103,7 +103,11 @@ UpdateApiKeyRequestBody request
public async Task 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)
@@ -125,17 +129,17 @@ public async Task 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
}
);
@@ -164,17 +168,17 @@ public async Task 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
}
);
@@ -189,10 +193,10 @@ public async Task ListApiRequestsAsync(ListApiRequestsR
public async Task 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();
@@ -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
}
);
@@ -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
}
);
@@ -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
}
);
@@ -300,10 +304,10 @@ CreateEnvironmentRequestBody request
public async Task 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();
@@ -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
}
);
@@ -338,10 +342,10 @@ UpdateEnvironmentRequestBody request
public async Task 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();
diff --git a/src/SchematicHQ.Client/Accounts/Types/ListApiKeysResponse.cs b/src/SchematicHQ.Client/Accounts/Types/ListApiKeysResponse.cs
index 1c569e2..bd4d7d0 100644
--- a/src/SchematicHQ.Client/Accounts/Types/ListApiKeysResponse.cs
+++ b/src/SchematicHQ.Client/Accounts/Types/ListApiKeysResponse.cs
@@ -11,7 +11,7 @@ public class ListApiKeysResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Accounts/Types/ListApiRequestsResponse.cs b/src/SchematicHQ.Client/Accounts/Types/ListApiRequestsResponse.cs
index 29980c9..f67d787 100644
--- a/src/SchematicHQ.Client/Accounts/Types/ListApiRequestsResponse.cs
+++ b/src/SchematicHQ.Client/Accounts/Types/ListApiRequestsResponse.cs
@@ -11,7 +11,7 @@ public class ListApiRequestsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsParams.cs b/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsParams.cs
index ea5a79f..92802b8 100644
--- a/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsParams.cs
+++ b/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class ListEnvironmentsParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsResponse.cs b/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsResponse.cs
index 5261cb8..3ac93e1 100644
--- a/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsResponse.cs
+++ b/src/SchematicHQ.Client/Accounts/Types/ListEnvironmentsResponse.cs
@@ -11,7 +11,7 @@ public class ListEnvironmentsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Billing/BillingClient.cs b/src/SchematicHQ.Client/Billing/BillingClient.cs
index 495ea46..95c7d17 100644
--- a/src/SchematicHQ.Client/Billing/BillingClient.cs
+++ b/src/SchematicHQ.Client/Billing/BillingClient.cs
@@ -19,10 +19,10 @@ CreateBillingProductRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/billing/product/upsert",
+ Path = "billing/product/upsert",
Body = request
}
);
@@ -47,17 +47,17 @@ public async Task ListProductsAsync(ListProductsRequest 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 = "/billing/products",
+ Path = "billing/products",
Query = _query
}
);
@@ -74,10 +74,10 @@ CreateBillingSubscriptionsRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/billing/subscription/upsert",
+ Path = "billing/subscription/upsert",
Body = request
}
);
diff --git a/src/SchematicHQ.Client/Billing/Requests/CreateBillingSubscriptionsRequestBody.cs b/src/SchematicHQ.Client/Billing/Requests/CreateBillingSubscriptionsRequestBody.cs
index 9d5f3f1..5a9cc8c 100644
--- a/src/SchematicHQ.Client/Billing/Requests/CreateBillingSubscriptionsRequestBody.cs
+++ b/src/SchematicHQ.Client/Billing/Requests/CreateBillingSubscriptionsRequestBody.cs
@@ -16,7 +16,7 @@ public class CreateBillingSubscriptionsRequestBody
public string? Interval { get; init; }
[JsonPropertyName("product_external_ids")]
- public List ProductExternalIds { get; init; }
+ public IEnumerable ProductExternalIds { get; init; }
[JsonPropertyName("subscription_external_id")]
public string SubscriptionExternalId { get; init; }
diff --git a/src/SchematicHQ.Client/Billing/Types/ListProductsParams.cs b/src/SchematicHQ.Client/Billing/Types/ListProductsParams.cs
index 0054066..89893f7 100644
--- a/src/SchematicHQ.Client/Billing/Types/ListProductsParams.cs
+++ b/src/SchematicHQ.Client/Billing/Types/ListProductsParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class ListProductsParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Billing/Types/ListProductsResponse.cs b/src/SchematicHQ.Client/Billing/Types/ListProductsResponse.cs
index 9bf90ce..fdfd5dc 100644
--- a/src/SchematicHQ.Client/Billing/Types/ListProductsResponse.cs
+++ b/src/SchematicHQ.Client/Billing/Types/ListProductsResponse.cs
@@ -11,7 +11,7 @@ public class ListProductsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/CompaniesClient.cs b/src/SchematicHQ.Client/Companies/CompaniesClient.cs
index 40fe1e0..73e1666 100644
--- a/src/SchematicHQ.Client/Companies/CompaniesClient.cs
+++ b/src/SchematicHQ.Client/Companies/CompaniesClient.cs
@@ -35,17 +35,17 @@ public async Task ListCompaniesAsync(ListCompaniesRequest
}
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 = "/companies",
+ Path = "companies",
Query = _query
}
);
@@ -60,10 +60,10 @@ public async Task ListCompaniesAsync(ListCompaniesRequest
public async Task UpsertCompanyAsync(UpsertCompanyRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/companies",
+ Path = "companies",
Body = request
}
);
@@ -78,7 +78,11 @@ public async Task UpsertCompanyAsync(UpsertCompanyRequest
public async Task GetCompanyAsync(string companyId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/companies/{companyId}" }
+ new RawClient.JsonApiRequest
+ {
+ Method = HttpMethod.Get,
+ Path = $"companies/{companyId}"
+ }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -91,10 +95,10 @@ public async Task GetCompanyAsync(string companyId)
public async Task DeleteCompanyAsync(string companyId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Delete,
- Path = $"/companies/{companyId}"
+ Path = $"companies/{companyId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -126,17 +130,17 @@ public async Task CountCompaniesAsync(CountCompaniesRequ
}
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 = "/companies/count",
+ Path = "companies/count",
Query = _query
}
);
@@ -151,10 +155,10 @@ public async Task CountCompaniesAsync(CountCompaniesRequ
public async Task CreateCompanyAsync(UpsertCompanyRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/companies/create",
+ Path = "companies/create",
Body = request
}
);
@@ -169,10 +173,10 @@ public async Task CreateCompanyAsync(UpsertCompanyRequest
public async Task DeleteCompanyByKeysAsync(KeysRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/companies/delete",
+ Path = "companies/delete",
Body = request
}
);
@@ -188,10 +192,10 @@ public async Task LookupCompanyAsync(LookupCompanyRequest
{
var _query = new Dictionary() { { "keys", request.Keys.ToString() }, };
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = "/companies/lookup",
+ Path = "companies/lookup",
Query = _query
}
);
@@ -212,17 +216,17 @@ public async Task GetActiveDealsAsync(GetActiveDealsRequ
};
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 = "/company-crm-deals",
+ Path = "company-crm-deals",
Query = _query
}
);
@@ -249,17 +253,17 @@ ListCompanyMembershipsRequest 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 = "/company-memberships",
+ Path = "company-memberships",
Query = _query
}
);
@@ -276,10 +280,10 @@ GetOrCreateCompanyMembershipRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/company-memberships",
+ Path = "company-memberships",
Body = request
}
);
@@ -296,10 +300,10 @@ string companyMembershipId
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Delete,
- Path = $"/company-memberships/{companyMembershipId}"
+ Path = $"company-memberships/{companyMembershipId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -325,17 +329,17 @@ ListCompanyPlansRequest 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 = "/company-plans",
+ Path = "company-plans",
Query = _query
}
);
@@ -354,17 +358,17 @@ GetActiveCompanySubscriptionRequest request
var _query = new Dictionary() { { "company_id", request.CompanyId }, };
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 = "/company-subscriptions",
+ Path = "company-subscriptions",
Query = _query
}
);
@@ -381,10 +385,10 @@ UpsertTraitRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/company-traits",
+ Path = "company-traits",
Body = request
}
);
@@ -403,7 +407,7 @@ ListEntityKeyDefinitionsRequest request
var _query = new Dictionary() { };
if (request.EntityType != null)
{
- _query["entity_type"] = request.EntityType;
+ _query["entity_type"] = JsonSerializer.Serialize(request.EntityType.Value);
}
if (request.Ids != null)
{
@@ -415,17 +419,17 @@ ListEntityKeyDefinitionsRequest 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 = "/entity-key-definitions",
+ Path = "entity-key-definitions",
Query = _query
}
);
@@ -444,7 +448,7 @@ CountEntityKeyDefinitionsRequest request
var _query = new Dictionary() { };
if (request.EntityType != null)
{
- _query["entity_type"] = request.EntityType;
+ _query["entity_type"] = JsonSerializer.Serialize(request.EntityType.Value);
}
if (request.Ids != null)
{
@@ -456,17 +460,17 @@ CountEntityKeyDefinitionsRequest 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 = "/entity-key-definitions/count",
+ Path = "entity-key-definitions/count",
Query = _query
}
);
@@ -485,7 +489,7 @@ ListEntityTraitDefinitionsRequest request
var _query = new Dictionary() { };
if (request.EntityType != null)
{
- _query["entity_type"] = request.EntityType;
+ _query["entity_type"] = JsonSerializer.Serialize(request.EntityType.Value);
}
if (request.Ids != null)
{
@@ -493,7 +497,7 @@ ListEntityTraitDefinitionsRequest request
}
if (request.TraitType != null)
{
- _query["trait_type"] = request.TraitType;
+ _query["trait_type"] = JsonSerializer.Serialize(request.TraitType.Value);
}
if (request.Q != null)
{
@@ -501,17 +505,17 @@ ListEntityTraitDefinitionsRequest 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 = "/entity-trait-definitions",
+ Path = "entity-trait-definitions",
Query = _query
}
);
@@ -528,10 +532,10 @@ CreateEntityTraitDefinitionRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/entity-trait-definitions",
+ Path = "entity-trait-definitions",
Body = request
}
);
@@ -550,10 +554,10 @@ string entityTraitDefinitionId
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = $"/entity-trait-definitions/{entityTraitDefinitionId}"
+ Path = $"entity-trait-definitions/{entityTraitDefinitionId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -570,10 +574,10 @@ UpdateEntityTraitDefinitionRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
- Path = $"/entity-trait-definitions/{entityTraitDefinitionId}",
+ Path = $"entity-trait-definitions/{entityTraitDefinitionId}",
Body = request
}
);
@@ -592,7 +596,7 @@ CountEntityTraitDefinitionsRequest request
var _query = new Dictionary() { };
if (request.EntityType != null)
{
- _query["entity_type"] = request.EntityType;
+ _query["entity_type"] = JsonSerializer.Serialize(request.EntityType.Value);
}
if (request.Ids != null)
{
@@ -600,7 +604,7 @@ CountEntityTraitDefinitionsRequest request
}
if (request.TraitType != null)
{
- _query["trait_type"] = request.TraitType;
+ _query["trait_type"] = JsonSerializer.Serialize(request.TraitType.Value);
}
if (request.Q != null)
{
@@ -608,17 +612,17 @@ CountEntityTraitDefinitionsRequest 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 = "/entity-trait-definitions/count",
+ Path = "entity-trait-definitions/count",
Query = _query
}
);
@@ -644,17 +648,17 @@ GetEntityTraitValuesRequest 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 = "/entity-trait-values",
+ Path = "entity-trait-values",
Query = _query
}
);
@@ -669,10 +673,10 @@ GetEntityTraitValuesRequest request
public async Task UpsertUserTraitAsync(UpsertTraitRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/user-traits",
+ Path = "user-traits",
Body = request
}
);
@@ -705,17 +709,17 @@ public async Task ListUsersAsync(ListUsersRequest 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 = "/users",
+ Path = "users",
Query = _query
}
);
@@ -730,10 +734,10 @@ public async Task ListUsersAsync(ListUsersRequest request)
public async Task UpsertUserAsync(UpsertUserRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/users",
+ Path = "users",
Body = request
}
);
@@ -748,7 +752,7 @@ public async Task UpsertUserAsync(UpsertUserRequestBody requ
public async Task GetUserAsync(string userId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/users/{userId}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"users/{userId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -761,7 +765,7 @@ public async Task GetUserAsync(string userId)
public async Task DeleteUserAsync(string userId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Delete, Path = $"/users/{userId}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Delete, Path = $"users/{userId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -792,17 +796,17 @@ public async Task CountUsersAsync(CountUsersRequest 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 = "/users/count",
+ Path = "users/count",
Query = _query
}
);
@@ -817,10 +821,10 @@ public async Task CountUsersAsync(CountUsersRequest request)
public async Task CreateUserAsync(UpsertUserRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/users/create",
+ Path = "users/create",
Body = request
}
);
@@ -835,10 +839,10 @@ public async Task CreateUserAsync(UpsertUserRequestBody requ
public async Task DeleteUserByKeysAsync(KeysRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/users/delete",
+ Path = "users/delete",
Body = request
}
);
@@ -854,10 +858,10 @@ public async Task LookupUserAsync(LookupUserRequest request)
{
var _query = new Dictionary() { { "keys", request.Keys.ToString() }, };
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = "/users/lookup",
+ Path = "users/lookup",
Query = _query
}
);
diff --git a/src/SchematicHQ.Client/Companies/Requests/CountEntityKeyDefinitionsRequest.cs b/src/SchematicHQ.Client/Companies/Requests/CountEntityKeyDefinitionsRequest.cs
index 366e89b..3f448c1 100644
--- a/src/SchematicHQ.Client/Companies/Requests/CountEntityKeyDefinitionsRequest.cs
+++ b/src/SchematicHQ.Client/Companies/Requests/CountEntityKeyDefinitionsRequest.cs
@@ -1,8 +1,12 @@
+using SchematicHQ.Client;
+
+#nullable enable
+
namespace SchematicHQ.Client;
public class CountEntityKeyDefinitionsRequest
{
- public string? EntityType { get; init; }
+ public CountEntityKeyDefinitionsRequestEntityType? EntityType { get; init; }
public string? Ids { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Requests/CountEntityTraitDefinitionsRequest.cs b/src/SchematicHQ.Client/Companies/Requests/CountEntityTraitDefinitionsRequest.cs
index 956cbe0..7552f25 100644
--- a/src/SchematicHQ.Client/Companies/Requests/CountEntityTraitDefinitionsRequest.cs
+++ b/src/SchematicHQ.Client/Companies/Requests/CountEntityTraitDefinitionsRequest.cs
@@ -1,12 +1,16 @@
+using SchematicHQ.Client;
+
+#nullable enable
+
namespace SchematicHQ.Client;
public class CountEntityTraitDefinitionsRequest
{
- public string? EntityType { get; init; }
+ public CountEntityTraitDefinitionsRequestEntityType? EntityType { get; init; }
public string? Ids { get; init; }
- public string? TraitType { get; init; }
+ public CountEntityTraitDefinitionsRequestTraitType? TraitType { get; init; }
public string? Q { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Requests/CreateEntityTraitDefinitionRequestBody.cs b/src/SchematicHQ.Client/Companies/Requests/CreateEntityTraitDefinitionRequestBody.cs
index a2c1229..71c5f06 100644
--- a/src/SchematicHQ.Client/Companies/Requests/CreateEntityTraitDefinitionRequestBody.cs
+++ b/src/SchematicHQ.Client/Companies/Requests/CreateEntityTraitDefinitionRequestBody.cs
@@ -14,7 +14,7 @@ public class CreateEntityTraitDefinitionRequestBody
public CreateEntityTraitDefinitionRequestBodyEntityType EntityType { get; init; }
[JsonPropertyName("hierarchy")]
- public List Hierarchy { get; init; }
+ public IEnumerable Hierarchy { get; init; }
[JsonPropertyName("trait_type")]
public CreateEntityTraitDefinitionRequestBodyTraitType TraitType { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Requests/ListEntityKeyDefinitionsRequest.cs b/src/SchematicHQ.Client/Companies/Requests/ListEntityKeyDefinitionsRequest.cs
index d9416c5..35450dc 100644
--- a/src/SchematicHQ.Client/Companies/Requests/ListEntityKeyDefinitionsRequest.cs
+++ b/src/SchematicHQ.Client/Companies/Requests/ListEntityKeyDefinitionsRequest.cs
@@ -1,8 +1,12 @@
+using SchematicHQ.Client;
+
+#nullable enable
+
namespace SchematicHQ.Client;
public class ListEntityKeyDefinitionsRequest
{
- public string? EntityType { get; init; }
+ public ListEntityKeyDefinitionsRequestEntityType? EntityType { get; init; }
public string? Ids { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Requests/ListEntityTraitDefinitionsRequest.cs b/src/SchematicHQ.Client/Companies/Requests/ListEntityTraitDefinitionsRequest.cs
index d137bde..df88db3 100644
--- a/src/SchematicHQ.Client/Companies/Requests/ListEntityTraitDefinitionsRequest.cs
+++ b/src/SchematicHQ.Client/Companies/Requests/ListEntityTraitDefinitionsRequest.cs
@@ -1,12 +1,16 @@
+using SchematicHQ.Client;
+
+#nullable enable
+
namespace SchematicHQ.Client;
public class ListEntityTraitDefinitionsRequest
{
- public string? EntityType { get; init; }
+ public ListEntityTraitDefinitionsRequestEntityType? EntityType { get; init; }
public string? Ids { get; init; }
- public string? TraitType { get; init; }
+ public ListEntityTraitDefinitionsRequestTraitType? TraitType { get; init; }
public string? Q { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Types/CountCompaniesParams.cs b/src/SchematicHQ.Client/Companies/Types/CountCompaniesParams.cs
index 792f498..bc491be 100644
--- a/src/SchematicHQ.Client/Companies/Types/CountCompaniesParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/CountCompaniesParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class CountCompaniesParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsParams.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsParams.cs
index 7384b40..7a02f1b 100644
--- a/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsParams.cs
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
+using SchematicHQ.Client;
#nullable enable
@@ -7,10 +8,10 @@ namespace SchematicHQ.Client;
public class CountEntityKeyDefinitionsParams
{
[JsonPropertyName("entity_type")]
- public string? EntityType { get; init; }
+ public CountEntityKeyDefinitionsResponseParamsEntityType? EntityType { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
[JsonPropertyName("key")]
public string? Key { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsRequestEntityType.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsRequestEntityType.cs
new file mode 100644
index 0000000..dbff765
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsRequestEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum CountEntityKeyDefinitionsRequestEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsResponseParamsEntityType.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsResponseParamsEntityType.cs
new file mode 100644
index 0000000..e2488a5
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityKeyDefinitionsResponseParamsEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum CountEntityKeyDefinitionsResponseParamsEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsParams.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsParams.cs
index 82a2bd8..593def4 100644
--- a/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsParams.cs
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
+using SchematicHQ.Client;
#nullable enable
@@ -7,10 +8,10 @@ namespace SchematicHQ.Client;
public class CountEntityTraitDefinitionsParams
{
[JsonPropertyName("entity_type")]
- public string? EntityType { get; init; }
+ public CountEntityTraitDefinitionsResponseParamsEntityType? EntityType { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
@@ -28,5 +29,5 @@ public class CountEntityTraitDefinitionsParams
public string? Q { get; init; }
[JsonPropertyName("trait_type")]
- public string? TraitType { get; init; }
+ public CountEntityTraitDefinitionsResponseParamsTraitType? TraitType { get; init; }
}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsRequestEntityType.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsRequestEntityType.cs
new file mode 100644
index 0000000..ace1a09
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsRequestEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum CountEntityTraitDefinitionsRequestEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsRequestTraitType.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsRequestTraitType.cs
new file mode 100644
index 0000000..e1a1d2a
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsRequestTraitType.cs
@@ -0,0 +1,30 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum CountEntityTraitDefinitionsRequestTraitType
+{
+ [EnumMember(Value = "boolean")]
+ Boolean,
+
+ [EnumMember(Value = "currency")]
+ Currency,
+
+ [EnumMember(Value = "date")]
+ Date,
+
+ [EnumMember(Value = "number")]
+ Number,
+
+ [EnumMember(Value = "string")]
+ String,
+
+ [EnumMember(Value = "url")]
+ Url
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsResponseParamsEntityType.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsResponseParamsEntityType.cs
new file mode 100644
index 0000000..5aa0158
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsResponseParamsEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum CountEntityTraitDefinitionsResponseParamsEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsResponseParamsTraitType.cs b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsResponseParamsTraitType.cs
new file mode 100644
index 0000000..74a4cb3
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/CountEntityTraitDefinitionsResponseParamsTraitType.cs
@@ -0,0 +1,30 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum CountEntityTraitDefinitionsResponseParamsTraitType
+{
+ [EnumMember(Value = "boolean")]
+ Boolean,
+
+ [EnumMember(Value = "currency")]
+ Currency,
+
+ [EnumMember(Value = "date")]
+ Date,
+
+ [EnumMember(Value = "number")]
+ Number,
+
+ [EnumMember(Value = "string")]
+ String,
+
+ [EnumMember(Value = "url")]
+ Url
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/CountUsersParams.cs b/src/SchematicHQ.Client/Companies/Types/CountUsersParams.cs
index 2b29786..60240c7 100644
--- a/src/SchematicHQ.Client/Companies/Types/CountUsersParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/CountUsersParams.cs
@@ -10,7 +10,7 @@ public class CountUsersParams
public string? CompanyId { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Companies/Types/GetActiveCompanySubscriptionResponse.cs b/src/SchematicHQ.Client/Companies/Types/GetActiveCompanySubscriptionResponse.cs
index 7d76a43..4a87003 100644
--- a/src/SchematicHQ.Client/Companies/Types/GetActiveCompanySubscriptionResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/GetActiveCompanySubscriptionResponse.cs
@@ -11,7 +11,7 @@ public class GetActiveCompanySubscriptionResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/GetActiveDealsResponse.cs b/src/SchematicHQ.Client/Companies/Types/GetActiveDealsResponse.cs
index 6c06320..ffa566c 100644
--- a/src/SchematicHQ.Client/Companies/Types/GetActiveDealsResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/GetActiveDealsResponse.cs
@@ -11,7 +11,7 @@ public class GetActiveDealsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/GetEntityTraitValuesResponse.cs b/src/SchematicHQ.Client/Companies/Types/GetEntityTraitValuesResponse.cs
index a700add..646720a 100644
--- a/src/SchematicHQ.Client/Companies/Types/GetEntityTraitValuesResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/GetEntityTraitValuesResponse.cs
@@ -11,7 +11,7 @@ public class GetEntityTraitValuesResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/ListCompaniesParams.cs b/src/SchematicHQ.Client/Companies/Types/ListCompaniesParams.cs
index bca7c53..3142e8d 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListCompaniesParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListCompaniesParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class ListCompaniesParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Companies/Types/ListCompaniesResponse.cs b/src/SchematicHQ.Client/Companies/Types/ListCompaniesResponse.cs
index a27b7e1..344eb1d 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListCompaniesResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListCompaniesResponse.cs
@@ -11,7 +11,7 @@ public class ListCompaniesResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/ListCompanyMembershipsResponse.cs b/src/SchematicHQ.Client/Companies/Types/ListCompanyMembershipsResponse.cs
index b477907..4ce4c9b 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListCompanyMembershipsResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListCompanyMembershipsResponse.cs
@@ -11,7 +11,7 @@ public class ListCompanyMembershipsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/ListCompanyPlansResponse.cs b/src/SchematicHQ.Client/Companies/Types/ListCompanyPlansResponse.cs
index b91d5d6..8fcc6dc 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListCompanyPlansResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListCompanyPlansResponse.cs
@@ -11,7 +11,7 @@ public class ListCompanyPlansResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsParams.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsParams.cs
index 4bf20bc..5aeb991 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsParams.cs
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
+using SchematicHQ.Client;
#nullable enable
@@ -7,10 +8,10 @@ namespace SchematicHQ.Client;
public class ListEntityKeyDefinitionsParams
{
[JsonPropertyName("entity_type")]
- public string? EntityType { get; init; }
+ public ListEntityKeyDefinitionsResponseParamsEntityType? EntityType { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
[JsonPropertyName("key")]
public string? Key { get; init; }
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsRequestEntityType.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsRequestEntityType.cs
new file mode 100644
index 0000000..f8685a1
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsRequestEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum ListEntityKeyDefinitionsRequestEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponse.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponse.cs
index b2d6a68..4aacf94 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponse.cs
@@ -11,7 +11,7 @@ public class ListEntityKeyDefinitionsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponseParamsEntityType.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponseParamsEntityType.cs
new file mode 100644
index 0000000..a0369b8
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityKeyDefinitionsResponseParamsEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum ListEntityKeyDefinitionsResponseParamsEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsParams.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsParams.cs
index 4d2d6d8..85a2eb9 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsParams.cs
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
+using SchematicHQ.Client;
#nullable enable
@@ -7,10 +8,10 @@ namespace SchematicHQ.Client;
public class ListEntityTraitDefinitionsParams
{
[JsonPropertyName("entity_type")]
- public string? EntityType { get; init; }
+ public ListEntityTraitDefinitionsResponseParamsEntityType? EntityType { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
@@ -28,5 +29,5 @@ public class ListEntityTraitDefinitionsParams
public string? Q { get; init; }
[JsonPropertyName("trait_type")]
- public string? TraitType { get; init; }
+ public ListEntityTraitDefinitionsResponseParamsTraitType? TraitType { get; init; }
}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsRequestEntityType.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsRequestEntityType.cs
new file mode 100644
index 0000000..c27869a
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsRequestEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum ListEntityTraitDefinitionsRequestEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsRequestTraitType.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsRequestTraitType.cs
new file mode 100644
index 0000000..8f9d93b
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsRequestTraitType.cs
@@ -0,0 +1,30 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum ListEntityTraitDefinitionsRequestTraitType
+{
+ [EnumMember(Value = "boolean")]
+ Boolean,
+
+ [EnumMember(Value = "currency")]
+ Currency,
+
+ [EnumMember(Value = "date")]
+ Date,
+
+ [EnumMember(Value = "number")]
+ Number,
+
+ [EnumMember(Value = "string")]
+ String,
+
+ [EnumMember(Value = "url")]
+ Url
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponse.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponse.cs
index 7575737..d0627a7 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponse.cs
@@ -11,7 +11,7 @@ public class ListEntityTraitDefinitionsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponseParamsEntityType.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponseParamsEntityType.cs
new file mode 100644
index 0000000..45081aa
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponseParamsEntityType.cs
@@ -0,0 +1,18 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum ListEntityTraitDefinitionsResponseParamsEntityType
+{
+ [EnumMember(Value = "company")]
+ Company,
+
+ [EnumMember(Value = "user")]
+ User
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponseParamsTraitType.cs b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponseParamsTraitType.cs
new file mode 100644
index 0000000..c9ad83f
--- /dev/null
+++ b/src/SchematicHQ.Client/Companies/Types/ListEntityTraitDefinitionsResponseParamsTraitType.cs
@@ -0,0 +1,30 @@
+using System.Runtime.Serialization;
+using System.Text.Json.Serialization;
+using SchematicHQ.Client;
+using SchematicHQ.Client.Core;
+
+#nullable enable
+
+namespace SchematicHQ.Client;
+
+[JsonConverter(typeof(StringEnumSerializer))]
+public enum ListEntityTraitDefinitionsResponseParamsTraitType
+{
+ [EnumMember(Value = "boolean")]
+ Boolean,
+
+ [EnumMember(Value = "currency")]
+ Currency,
+
+ [EnumMember(Value = "date")]
+ Date,
+
+ [EnumMember(Value = "number")]
+ Number,
+
+ [EnumMember(Value = "string")]
+ String,
+
+ [EnumMember(Value = "url")]
+ Url
+}
diff --git a/src/SchematicHQ.Client/Companies/Types/ListUsersParams.cs b/src/SchematicHQ.Client/Companies/Types/ListUsersParams.cs
index 5a4387e..c8b801a 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListUsersParams.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListUsersParams.cs
@@ -10,7 +10,7 @@ public class ListUsersParams
public string? CompanyId { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Companies/Types/ListUsersResponse.cs b/src/SchematicHQ.Client/Companies/Types/ListUsersResponse.cs
index 9af4454..84b1780 100644
--- a/src/SchematicHQ.Client/Companies/Types/ListUsersResponse.cs
+++ b/src/SchematicHQ.Client/Companies/Types/ListUsersResponse.cs
@@ -11,7 +11,7 @@ public class ListUsersResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Core/CollectionItemSerializer.cs b/src/SchematicHQ.Client/Core/CollectionItemSerializer.cs
new file mode 100644
index 0000000..22dfafe
--- /dev/null
+++ b/src/SchematicHQ.Client/Core/CollectionItemSerializer.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Collections.Generic;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace SchematicHQ.Client;
+
+///
+/// Json collection converter.
+///
+/// Type of item to convert.
+/// Converter to use for individual items.
+public class CollectionItemSerializer
+ : JsonConverter>
+ where TConverterType : JsonConverter
+{
+ ///
+ /// Reads a json string and deserializes it into an object.
+ ///
+ /// Json reader.
+ /// Type to convert.
+ /// Serializer options.
+ /// Created object.
+ public override IEnumerable Read(
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options
+ )
+ {
+ if (reader.TokenType == JsonTokenType.Null)
+ {
+ return default(IEnumerable);
+ }
+
+ JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(options);
+ jsonSerializerOptions.Converters.Clear();
+ jsonSerializerOptions.Converters.Add(Activator.CreateInstance());
+
+ List returnValue = new List();
+
+ while (reader.TokenType != JsonTokenType.EndArray)
+ {
+ if (reader.TokenType != JsonTokenType.StartArray)
+ {
+ returnValue.Add(
+ (TDatatype)
+ JsonSerializer.Deserialize(
+ ref reader,
+ typeof(TDatatype),
+ jsonSerializerOptions
+ )
+ );
+ }
+
+ reader.Read();
+ }
+
+ return returnValue;
+ }
+
+ ///
+ /// Writes a json string.
+ ///
+ /// Json writer.
+ /// Value to write.
+ /// Serializer options.
+ public override void Write(
+ Utf8JsonWriter writer,
+ IEnumerable value,
+ JsonSerializerOptions options
+ )
+ {
+ if (value == null)
+ {
+ writer.WriteNullValue();
+ return;
+ }
+
+ JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions(options);
+ jsonSerializerOptions.Converters.Clear();
+ jsonSerializerOptions.Converters.Add(Activator.CreateInstance());
+
+ writer.WriteStartArray();
+
+ foreach (TDatatype data in value)
+ {
+ JsonSerializer.Serialize(writer, data, jsonSerializerOptions);
+ }
+
+ writer.WriteEndArray();
+ }
+}
diff --git a/src/SchematicHQ.Client/Core/RawClient.cs b/src/SchematicHQ.Client/Core/RawClient.cs
index ba63f26..809dd9f 100644
--- a/src/SchematicHQ.Client/Core/RawClient.cs
+++ b/src/SchematicHQ.Client/Core/RawClient.cs
@@ -26,12 +26,10 @@ public RawClient(Dictionary headers, ClientOptions clientOptions
_headers = headers;
}
- public async Task MakeRequestAsync(ApiRequest request)
+ public async Task MakeRequestAsync(BaseApiRequest request)
{
- var httpRequest = new HttpRequestMessage(
- request.Method,
- this.BuildUrl(request.Path, request.Query)
- );
+ var url = this.BuildUrl(request.Path, request.Query);
+ var httpRequest = new HttpRequestMessage(request.Method, url);
if (request.ContentType != null)
{
request.Headers.Add("Content-Type", request.ContentType);
@@ -47,24 +45,31 @@ public async Task MakeRequestAsync(ApiRequest request)
httpRequest.Headers.Add(key, value);
}
// Add the request body to the request
- if (request.Body != null)
+ if (request is JsonApiRequest jsonRequest)
{
- var serializerOptions = new JsonSerializerOptions { WriteIndented = true, };
- httpRequest.Content = new StringContent(
- JsonSerializer.Serialize(request.Body, serializerOptions),
- Encoding.UTF8,
- "application/json"
- );
+ if (jsonRequest.Body != null)
+ {
+ var serializerOptions = new JsonSerializerOptions { WriteIndented = true, };
+ httpRequest.Content = new StringContent(
+ JsonSerializer.Serialize(jsonRequest.Body, serializerOptions),
+ Encoding.UTF8,
+ "application/json"
+ );
+ }
+ }
+ else if (request is StreamApiRequest streamRequest)
+ {
+ if (streamRequest.Body != null)
+ {
+ httpRequest.Content = new StreamContent(streamRequest.Body);
+ }
}
// Send the request
HttpResponseMessage response = await _clientOptions.HttpClient.SendAsync(httpRequest);
return new ApiResponse { StatusCode = (int)response.StatusCode, Raw = response };
}
- ///
- /// The request object to be sent to the API.
- ///
- public class ApiRequest
+ public abstract class BaseApiRequest
{
public HttpMethod Method;
@@ -72,8 +77,6 @@ public class ApiRequest
public string? ContentType = null;
- public object? Body { get; init; } = null;
-
public Dictionary Query { get; init; } = new();
public Dictionary Headers { get; init; } = new();
@@ -81,6 +84,22 @@ public class ApiRequest
public object RequestOptions { get; init; }
}
+ ///
+ /// The request object to be sent for streaming uploads.
+ ///
+ public class StreamApiRequest : BaseApiRequest
+ {
+ public Stream? Body { get; init; } = null;
+ }
+
+ ///
+ /// The request object to be sent for JSON APIs.
+ ///
+ public class JsonApiRequest : BaseApiRequest
+ {
+ public object? Body { get; init; } = null;
+ }
+
///
/// The response object returned from the API.
///
@@ -91,7 +110,7 @@ public class ApiResponse
public HttpResponseMessage Raw;
}
- private Dictionary GetHeaders(ApiRequest request)
+ private Dictionary GetHeaders(BaseApiRequest request)
{
var headers = new Dictionary();
foreach (var (key, value) in request.Headers)
@@ -105,9 +124,11 @@ private Dictionary GetHeaders(ApiRequest request)
return headers;
}
- private string BuildUrl(string path, Dictionary query)
+ public string BuildUrl(string path, Dictionary query)
{
- var url = $"{_clientOptions.BaseUrl}{path}";
+ var trimmedBaseUrl = _clientOptions.BaseUrl.TrimEnd('/');
+ var trimmedBasePath = path.TrimStart('/');
+ var url = $"{trimmedBaseUrl}/{trimmedBasePath}";
if (query.Count > 0)
{
url += "?";
diff --git a/src/SchematicHQ.Client/Crm/CrmClient.cs b/src/SchematicHQ.Client/Crm/CrmClient.cs
index 296bf02..6e4c44d 100644
--- a/src/SchematicHQ.Client/Crm/CrmClient.cs
+++ b/src/SchematicHQ.Client/Crm/CrmClient.cs
@@ -19,10 +19,10 @@ CreateCrmDealLineItemAssociationRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/crm/associations/deal-line-item",
+ Path = "crm/associations/deal-line-item",
Body = request
}
);
@@ -39,10 +39,10 @@ CreateCrmLineItemRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/crm/deal-line-item/upsert",
+ Path = "crm/deal-line-item/upsert",
Body = request
}
);
@@ -57,10 +57,10 @@ CreateCrmLineItemRequestBody request
public async Task UpsertCrmDealAsync(CreateCrmDealRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/crm/deals/upsert",
+ Path = "crm/deals/upsert",
Body = request
}
);
@@ -85,17 +85,17 @@ public async Task ListCrmProductsAsync(ListCrmProductsR
}
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 = "/crm/products",
+ Path = "crm/products",
Query = _query
}
);
@@ -112,10 +112,10 @@ CreateCrmProductRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/crm/products/upsert",
+ Path = "crm/products/upsert",
Body = request
}
);
diff --git a/src/SchematicHQ.Client/Crm/Types/ListCrmProductsParams.cs b/src/SchematicHQ.Client/Crm/Types/ListCrmProductsParams.cs
index 7314119..400df78 100644
--- a/src/SchematicHQ.Client/Crm/Types/ListCrmProductsParams.cs
+++ b/src/SchematicHQ.Client/Crm/Types/ListCrmProductsParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class ListCrmProductsParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Crm/Types/ListCrmProductsResponse.cs b/src/SchematicHQ.Client/Crm/Types/ListCrmProductsResponse.cs
index 6a2ce6f..68ff459 100644
--- a/src/SchematicHQ.Client/Crm/Types/ListCrmProductsResponse.cs
+++ b/src/SchematicHQ.Client/Crm/Types/ListCrmProductsResponse.cs
@@ -11,7 +11,7 @@ public class ListCrmProductsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Entitlements/EntitlementsClient.cs b/src/SchematicHQ.Client/Entitlements/EntitlementsClient.cs
index 17c3573..ebf97a1 100644
--- a/src/SchematicHQ.Client/Entitlements/EntitlementsClient.cs
+++ b/src/SchematicHQ.Client/Entitlements/EntitlementsClient.cs
@@ -41,17 +41,17 @@ ListCompanyOverridesRequest 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 = "/company-overrides",
+ Path = "company-overrides",
Query = _query
}
);
@@ -68,10 +68,10 @@ CreateCompanyOverrideRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/company-overrides",
+ Path = "company-overrides",
Body = request
}
);
@@ -86,10 +86,10 @@ CreateCompanyOverrideRequestBody request
public async Task GetCompanyOverrideAsync(string companyOverrideId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = $"/company-overrides/{companyOverrideId}"
+ Path = $"company-overrides/{companyOverrideId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -106,10 +106,10 @@ UpdateCompanyOverrideRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
- Path = $"/company-overrides/{companyOverrideId}",
+ Path = $"company-overrides/{companyOverrideId}",
Body = request
}
);
@@ -126,10 +126,10 @@ string companyOverrideId
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Delete,
- Path = $"/company-overrides/{companyOverrideId}"
+ Path = $"company-overrides/{companyOverrideId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -167,17 +167,17 @@ CountCompanyOverridesRequest 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 = "/company-overrides/count",
+ Path = "company-overrides/count",
Query = _query
}
);
@@ -200,17 +200,17 @@ ListFeatureCompaniesRequest 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 = "/feature-companies",
+ Path = "feature-companies",
Query = _query
}
);
@@ -233,17 +233,17 @@ CountFeatureCompaniesRequest 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 = "/feature-companies/count",
+ Path = "feature-companies/count",
Query = _query
}
);
@@ -266,7 +266,7 @@ ListFeatureUsageRequest request
}
if (request.CompanyKeys != null)
{
- _query["company_keys"] = request.CompanyKeys;
+ _query["company_keys"] = request.CompanyKeys.ToString();
}
if (request.FeatureIds != null)
{
@@ -278,17 +278,17 @@ ListFeatureUsageRequest 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 = "/feature-usage",
+ Path = "feature-usage",
Query = _query
}
);
@@ -311,7 +311,7 @@ CountFeatureUsageRequest request
}
if (request.CompanyKeys != null)
{
- _query["company_keys"] = request.CompanyKeys;
+ _query["company_keys"] = request.CompanyKeys.ToString();
}
if (request.FeatureIds != null)
{
@@ -323,17 +323,17 @@ CountFeatureUsageRequest 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 = "/feature-usage/count",
+ Path = "feature-usage/count",
Query = _query
}
);
@@ -356,17 +356,17 @@ ListFeatureUsersRequest 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 = "/feature-users",
+ Path = "feature-users",
Query = _query
}
);
@@ -389,17 +389,17 @@ CountFeatureUsersRequest 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 = "/feature-users/count",
+ Path = "feature-users/count",
Query = _query
}
);
@@ -436,19 +436,23 @@ ListPlanEntitlementsRequest request
{
_query["plan_ids"] = request.PlanIds;
}
+ if (request.Q != null)
+ {
+ _query["q"] = request.Q;
+ }
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 = "/plan-entitlements",
+ Path = "plan-entitlements",
Query = _query
}
);
@@ -465,10 +469,10 @@ CreatePlanEntitlementRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/plan-entitlements",
+ Path = "plan-entitlements",
Body = request
}
);
@@ -483,10 +487,10 @@ CreatePlanEntitlementRequestBody request
public async Task GetPlanEntitlementAsync(string planEntitlementId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = $"/plan-entitlements/{planEntitlementId}"
+ Path = $"plan-entitlements/{planEntitlementId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -503,10 +507,10 @@ UpdatePlanEntitlementRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
- Path = $"/plan-entitlements/{planEntitlementId}",
+ Path = $"plan-entitlements/{planEntitlementId}",
Body = request
}
);
@@ -523,10 +527,10 @@ string planEntitlementId
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Delete,
- Path = $"/plan-entitlements/{planEntitlementId}"
+ Path = $"plan-entitlements/{planEntitlementId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -562,19 +566,23 @@ CountPlanEntitlementsRequest request
{
_query["plan_ids"] = request.PlanIds;
}
+ if (request.Q != null)
+ {
+ _query["q"] = request.Q;
+ }
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 = "/plan-entitlements/count",
+ Path = "plan-entitlements/count",
Query = _query
}
);
@@ -592,10 +600,10 @@ GetFeatureUsageByCompanyRequest request
{
var _query = new Dictionary() { { "keys", request.Keys.ToString() }, };
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = "/usage-by-company",
+ Path = "usage-by-company",
Query = _query
}
);
diff --git a/src/SchematicHQ.Client/Entitlements/Requests/CountPlanEntitlementsRequest.cs b/src/SchematicHQ.Client/Entitlements/Requests/CountPlanEntitlementsRequest.cs
index 83a4682..3976730 100644
--- a/src/SchematicHQ.Client/Entitlements/Requests/CountPlanEntitlementsRequest.cs
+++ b/src/SchematicHQ.Client/Entitlements/Requests/CountPlanEntitlementsRequest.cs
@@ -12,6 +12,8 @@ public class CountPlanEntitlementsRequest
public string? PlanIds { get; init; }
+ public string? Q { get; init; }
+
///
/// Page limit (default 100)
///
diff --git a/src/SchematicHQ.Client/Entitlements/Requests/ListPlanEntitlementsRequest.cs b/src/SchematicHQ.Client/Entitlements/Requests/ListPlanEntitlementsRequest.cs
index 0663d3d..befd20c 100644
--- a/src/SchematicHQ.Client/Entitlements/Requests/ListPlanEntitlementsRequest.cs
+++ b/src/SchematicHQ.Client/Entitlements/Requests/ListPlanEntitlementsRequest.cs
@@ -12,6 +12,8 @@ public class ListPlanEntitlementsRequest
public string? PlanIds { get; init; }
+ public string? Q { get; init; }
+
///
/// Page limit (default 100)
///
diff --git a/src/SchematicHQ.Client/Entitlements/Types/CountCompanyOverridesParams.cs b/src/SchematicHQ.Client/Entitlements/Types/CountCompanyOverridesParams.cs
index 5d94b53..538267c 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/CountCompanyOverridesParams.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/CountCompanyOverridesParams.cs
@@ -10,16 +10,16 @@ public class CountCompanyOverridesParams
public string? CompanyId { get; init; }
[JsonPropertyName("company_ids")]
- public List? CompanyIds { get; init; }
+ public IEnumerable? CompanyIds { get; init; }
[JsonPropertyName("feature_id")]
public string? FeatureId { get; init; }
[JsonPropertyName("feature_ids")]
- public List? FeatureIds { get; init; }
+ public IEnumerable? FeatureIds { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Entitlements/Types/CountFeatureUsageParams.cs b/src/SchematicHQ.Client/Entitlements/Types/CountFeatureUsageParams.cs
index c730241..72fa650 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/CountFeatureUsageParams.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/CountFeatureUsageParams.cs
@@ -13,7 +13,7 @@ public class CountFeatureUsageParams
public Dictionary? CompanyKeys { get; init; }
[JsonPropertyName("feature_ids")]
- public List? FeatureIds { get; init; }
+ public IEnumerable? FeatureIds { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Entitlements/Types/CountPlanEntitlementsParams.cs b/src/SchematicHQ.Client/Entitlements/Types/CountPlanEntitlementsParams.cs
index 859ceb3..c693c84 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/CountPlanEntitlementsParams.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/CountPlanEntitlementsParams.cs
@@ -10,10 +10,10 @@ public class CountPlanEntitlementsParams
public string? FeatureId { get; init; }
[JsonPropertyName("feature_ids")]
- public List? FeatureIds { get; init; }
+ public IEnumerable? FeatureIds { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
@@ -31,5 +31,8 @@ public class CountPlanEntitlementsParams
public string? PlanId { get; init; }
[JsonPropertyName("plan_ids")]
- public List? PlanIds { get; init; }
+ public IEnumerable? PlanIds { get; init; }
+
+ [JsonPropertyName("q")]
+ public string? Q { get; init; }
}
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesParams.cs b/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesParams.cs
index 879b0a4..26cfd17 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesParams.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesParams.cs
@@ -10,16 +10,16 @@ public class ListCompanyOverridesParams
public string? CompanyId { get; init; }
[JsonPropertyName("company_ids")]
- public List? CompanyIds { get; init; }
+ public IEnumerable? CompanyIds { get; init; }
[JsonPropertyName("feature_id")]
public string? FeatureId { get; init; }
[JsonPropertyName("feature_ids")]
- public List? FeatureIds { get; init; }
+ public IEnumerable? FeatureIds { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesResponse.cs b/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesResponse.cs
index ce916a6..c9d0a37 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesResponse.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListCompanyOverridesResponse.cs
@@ -11,7 +11,7 @@ public class ListCompanyOverridesResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureCompaniesResponse.cs b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureCompaniesResponse.cs
index 43d0fce..96d20d1 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureCompaniesResponse.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureCompaniesResponse.cs
@@ -11,7 +11,7 @@ public class ListFeatureCompaniesResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageParams.cs b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageParams.cs
index 31b8030..2a42089 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageParams.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageParams.cs
@@ -13,7 +13,7 @@ public class ListFeatureUsageParams
public Dictionary? CompanyKeys { get; init; }
[JsonPropertyName("feature_ids")]
- public List? FeatureIds { get; init; }
+ public IEnumerable? FeatureIds { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageResponse.cs b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageResponse.cs
index adb6476..3a44068 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageResponse.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsageResponse.cs
@@ -11,7 +11,7 @@ public class ListFeatureUsageResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsersResponse.cs b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsersResponse.cs
index 6f83780..37e38b9 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsersResponse.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListFeatureUsersResponse.cs
@@ -11,7 +11,7 @@ public class ListFeatureUsersResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsParams.cs b/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsParams.cs
index c09eb11..edc0f7c 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsParams.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsParams.cs
@@ -10,10 +10,10 @@ public class ListPlanEntitlementsParams
public string? FeatureId { get; init; }
[JsonPropertyName("feature_ids")]
- public List? FeatureIds { get; init; }
+ public IEnumerable? FeatureIds { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
@@ -31,5 +31,8 @@ public class ListPlanEntitlementsParams
public string? PlanId { get; init; }
[JsonPropertyName("plan_ids")]
- public List? PlanIds { get; init; }
+ public IEnumerable? PlanIds { get; init; }
+
+ [JsonPropertyName("q")]
+ public string? Q { get; init; }
}
diff --git a/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsResponse.cs b/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsResponse.cs
index 59c3549..6606368 100644
--- a/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsResponse.cs
+++ b/src/SchematicHQ.Client/Entitlements/Types/ListPlanEntitlementsResponse.cs
@@ -11,7 +11,7 @@ public class ListPlanEntitlementsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Events/EventsClient.cs b/src/SchematicHQ.Client/Events/EventsClient.cs
index 537923a..d15e52e 100644
--- a/src/SchematicHQ.Client/Events/EventsClient.cs
+++ b/src/SchematicHQ.Client/Events/EventsClient.cs
@@ -19,10 +19,10 @@ CreateEventBatchRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/event-batch",
+ Path = "event-batch",
Body = request
}
);
@@ -49,17 +49,17 @@ GetEventSummariesRequest 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 = "/event-types",
+ Path = "event-types",
Query = _query
}
);
@@ -74,7 +74,7 @@ GetEventSummariesRequest request
public async Task GetEventSummaryBySubtypeAsync(string key)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/event-types/{key}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"event-types/{key}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -101,17 +101,17 @@ public async Task ListEventsAsync(ListEventsRequest 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 = "/events",
+ Path = "events",
Query = _query
}
);
@@ -126,10 +126,10 @@ public async Task ListEventsAsync(ListEventsRequest request)
public async Task CreateEventAsync(CreateEventRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/events",
+ Path = "events",
Body = request
}
);
@@ -144,7 +144,7 @@ public async Task CreateEventAsync(CreateEventRequestBody r
public async Task GetEventAsync(string eventId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/events/{eventId}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"events/{eventId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -161,11 +161,11 @@ ListMetricCountsRequest request
var _query = new Dictionary() { };
if (request.StartTime != null)
{
- _query["start_time"] = request.StartTime;
+ _query["start_time"] = request.StartTime.Value.ToString("o0");
}
if (request.EndTime != null)
{
- _query["end_time"] = request.EndTime;
+ _query["end_time"] = request.EndTime.Value.ToString("o0");
}
if (request.EventSubtype != null)
{
@@ -189,21 +189,21 @@ ListMetricCountsRequest 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();
}
if (request.Grouping != null)
{
_query["grouping"] = request.Grouping;
}
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = "/metric-counts",
+ Path = "metric-counts",
Query = _query
}
);
@@ -218,7 +218,7 @@ ListMetricCountsRequest request
public async Task GetSegmentIntegrationStatusAsync()
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = "/segment-integration" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = "segment-integration" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
diff --git a/src/SchematicHQ.Client/Events/Requests/CreateEventBatchRequestBody.cs b/src/SchematicHQ.Client/Events/Requests/CreateEventBatchRequestBody.cs
index 7a390c8..eee2348 100644
--- a/src/SchematicHQ.Client/Events/Requests/CreateEventBatchRequestBody.cs
+++ b/src/SchematicHQ.Client/Events/Requests/CreateEventBatchRequestBody.cs
@@ -8,5 +8,5 @@ namespace SchematicHQ.Client;
public class CreateEventBatchRequestBody
{
[JsonPropertyName("events")]
- public List Events { get; init; }
+ public IEnumerable Events { get; init; }
}
diff --git a/src/SchematicHQ.Client/Events/Types/GetEventSummariesParams.cs b/src/SchematicHQ.Client/Events/Types/GetEventSummariesParams.cs
index cc2dfbc..dd43661 100644
--- a/src/SchematicHQ.Client/Events/Types/GetEventSummariesParams.cs
+++ b/src/SchematicHQ.Client/Events/Types/GetEventSummariesParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class GetEventSummariesParams
{
[JsonPropertyName("event_subtypes")]
- public List? EventSubtypes { get; init; }
+ public IEnumerable? EventSubtypes { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Events/Types/GetEventSummariesResponse.cs b/src/SchematicHQ.Client/Events/Types/GetEventSummariesResponse.cs
index 2e7da0a..7c259b7 100644
--- a/src/SchematicHQ.Client/Events/Types/GetEventSummariesResponse.cs
+++ b/src/SchematicHQ.Client/Events/Types/GetEventSummariesResponse.cs
@@ -11,7 +11,7 @@ public class GetEventSummariesResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Events/Types/ListEventsResponse.cs b/src/SchematicHQ.Client/Events/Types/ListEventsResponse.cs
index 2c36641..633f4a5 100644
--- a/src/SchematicHQ.Client/Events/Types/ListEventsResponse.cs
+++ b/src/SchematicHQ.Client/Events/Types/ListEventsResponse.cs
@@ -11,7 +11,7 @@ public class ListEventsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Events/Types/ListMetricCountsParams.cs b/src/SchematicHQ.Client/Events/Types/ListMetricCountsParams.cs
index cd602ef..0ae0391 100644
--- a/src/SchematicHQ.Client/Events/Types/ListMetricCountsParams.cs
+++ b/src/SchematicHQ.Client/Events/Types/ListMetricCountsParams.cs
@@ -10,7 +10,7 @@ public class ListMetricCountsParams
public string? CompanyId { get; init; }
[JsonPropertyName("company_ids")]
- public List? CompanyIds { get; init; }
+ public IEnumerable? CompanyIds { get; init; }
[JsonPropertyName("end_time")]
public DateTime? EndTime { get; init; }
@@ -19,7 +19,7 @@ public class ListMetricCountsParams
public string? EventSubtype { get; init; }
[JsonPropertyName("event_subtypes")]
- public List? EventSubtypes { get; init; }
+ public IEnumerable? EventSubtypes { get; init; }
[JsonPropertyName("grouping")]
public string? Grouping { get; init; }
diff --git a/src/SchematicHQ.Client/Events/Types/ListMetricCountsResponse.cs b/src/SchematicHQ.Client/Events/Types/ListMetricCountsResponse.cs
index 514b554..9368a08 100644
--- a/src/SchematicHQ.Client/Events/Types/ListMetricCountsResponse.cs
+++ b/src/SchematicHQ.Client/Events/Types/ListMetricCountsResponse.cs
@@ -11,7 +11,7 @@ public class ListMetricCountsResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Features/FeaturesClient.cs b/src/SchematicHQ.Client/Features/FeaturesClient.cs
index 9fe1ea8..dbce11f 100644
--- a/src/SchematicHQ.Client/Features/FeaturesClient.cs
+++ b/src/SchematicHQ.Client/Features/FeaturesClient.cs
@@ -19,10 +19,10 @@ AudienceRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/audience/count-companies",
+ Path = "audience/count-companies",
Body = request
}
);
@@ -39,10 +39,10 @@ AudienceRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/audience/count-users",
+ Path = "audience/count-users",
Body = request
}
);
@@ -59,10 +59,10 @@ AudienceRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/audience/get-companies",
+ Path = "audience/get-companies",
Body = request
}
);
@@ -77,10 +77,10 @@ AudienceRequestBody request
public async Task ListAudienceUsersAsync(AudienceRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/audience/get-users",
+ Path = "audience/get-users",
Body = request
}
);
@@ -113,17 +113,17 @@ public async Task ListFeaturesAsync(ListFeaturesRequest 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 = "/features",
+ Path = "features",
Query = _query
}
);
@@ -138,10 +138,10 @@ public async Task ListFeaturesAsync(ListFeaturesRequest re
public async Task CreateFeatureAsync(CreateFeatureRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/features",
+ Path = "features",
Body = request
}
);
@@ -156,7 +156,7 @@ public async Task CreateFeatureAsync(CreateFeatureRequest
public async Task GetFeatureAsync(string featureId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/features/{featureId}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"features/{featureId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -172,10 +172,10 @@ UpdateFeatureRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
- Path = $"/features/{featureId}",
+ Path = $"features/{featureId}",
Body = request
}
);
@@ -190,7 +190,11 @@ UpdateFeatureRequestBody request
public async Task DeleteFeatureAsync(string featureId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Delete, Path = $"/features/{featureId}" }
+ new RawClient.JsonApiRequest
+ {
+ Method = HttpMethod.Delete,
+ Path = $"features/{featureId}"
+ }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -221,17 +225,17 @@ public async Task CountFeaturesAsync(CountFeaturesRequest
}
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 = "/features/count",
+ Path = "features/count",
Query = _query
}
);
@@ -260,17 +264,17 @@ public async Task ListFlagChecksAsync(ListFlagChecksRequ
}
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 = "/flag-checks",
+ Path = "flag-checks",
Query = _query
}
);
@@ -285,10 +289,10 @@ public async Task ListFlagChecksAsync(ListFlagChecksRequ
public async Task GetFlagCheckAsync(string flagCheckId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Get,
- Path = $"/flag-checks/{flagCheckId}"
+ Path = $"flag-checks/{flagCheckId}"
}
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
@@ -316,17 +320,17 @@ public async Task CountFlagChecksAsync(CountFlagChecksR
}
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 = "/flag-checks/count",
+ Path = "flag-checks/count",
Query = _query
}
);
@@ -357,17 +361,17 @@ GetLatestFlagChecksRequest 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 = "/flag-checks/latest",
+ Path = "flag-checks/latest",
Query = _query
}
);
@@ -396,17 +400,17 @@ public async Task ListFlagsAsync(ListFlagsRequest 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 = "/flags",
+ Path = "flags",
Query = _query
}
);
@@ -421,10 +425,10 @@ public async Task ListFlagsAsync(ListFlagsRequest request)
public async Task CreateFlagAsync(CreateFlagRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/flags",
+ Path = "flags",
Body = request
}
);
@@ -439,7 +443,7 @@ public async Task CreateFlagAsync(CreateFlagRequestBody requ
public async Task GetFlagAsync(string flagId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Get, Path = $"/flags/{flagId}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Get, Path = $"flags/{flagId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -455,10 +459,10 @@ CreateFlagRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
- Path = $"/flags/{flagId}",
+ Path = $"flags/{flagId}",
Body = request
}
);
@@ -473,7 +477,7 @@ CreateFlagRequestBody request
public async Task DeleteFlagAsync(string flagId)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest { Method = HttpMethod.Delete, Path = $"/flags/{flagId}" }
+ new RawClient.JsonApiRequest { Method = HttpMethod.Delete, Path = $"flags/{flagId}" }
);
string responseBody = await response.Raw.Content.ReadAsStringAsync();
if (response.StatusCode >= 200 && response.StatusCode < 400)
@@ -489,10 +493,10 @@ UpdateFlagRulesRequestBody request
)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Put,
- Path = $"/flags/{flagId}/rules",
+ Path = $"flags/{flagId}/rules",
Body = request
}
);
@@ -507,10 +511,10 @@ UpdateFlagRulesRequestBody request
public async Task CheckFlagAsync(string key, CheckFlagRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = $"/flags/{key}/check",
+ Path = $"flags/{key}/check",
Body = request
}
);
@@ -525,10 +529,10 @@ public async Task CheckFlagAsync(string key, CheckFlagRequest
public async Task CheckFlagsAsync(CheckFlagRequestBody request)
{
var response = await _client.MakeRequestAsync(
- new RawClient.ApiRequest
+ new RawClient.JsonApiRequest
{
Method = HttpMethod.Post,
- Path = "/flags/check",
+ Path = "flags/check",
Body = request
}
);
@@ -557,17 +561,17 @@ public async Task CountFlagsAsync(CountFlagsRequest 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 = "/flags/count",
+ Path = "flags/count",
Query = _query
}
);
diff --git a/src/SchematicHQ.Client/Features/Requests/UpdateFlagRulesRequestBody.cs b/src/SchematicHQ.Client/Features/Requests/UpdateFlagRulesRequestBody.cs
index ae1e49c..f8c7da3 100644
--- a/src/SchematicHQ.Client/Features/Requests/UpdateFlagRulesRequestBody.cs
+++ b/src/SchematicHQ.Client/Features/Requests/UpdateFlagRulesRequestBody.cs
@@ -8,5 +8,5 @@ namespace SchematicHQ.Client;
public class UpdateFlagRulesRequestBody
{
[JsonPropertyName("rules")]
- public List Rules { get; init; }
+ public IEnumerable Rules { get; init; }
}
diff --git a/src/SchematicHQ.Client/Features/Types/CountFeaturesParams.cs b/src/SchematicHQ.Client/Features/Types/CountFeaturesParams.cs
index 91e41d8..8bf62a2 100644
--- a/src/SchematicHQ.Client/Features/Types/CountFeaturesParams.cs
+++ b/src/SchematicHQ.Client/Features/Types/CountFeaturesParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class CountFeaturesParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Features/Types/CountFlagChecksParams.cs b/src/SchematicHQ.Client/Features/Types/CountFlagChecksParams.cs
index 87f96fa..fb364c6 100644
--- a/src/SchematicHQ.Client/Features/Types/CountFlagChecksParams.cs
+++ b/src/SchematicHQ.Client/Features/Types/CountFlagChecksParams.cs
@@ -10,7 +10,7 @@ public class CountFlagChecksParams
public string? FlagId { get; init; }
[JsonPropertyName("flag_ids")]
- public List? FlagIds { get; init; }
+ public IEnumerable? FlagIds { get; init; }
[JsonPropertyName("id")]
public string? Id { get; init; }
diff --git a/src/SchematicHQ.Client/Features/Types/CountFlagsParams.cs b/src/SchematicHQ.Client/Features/Types/CountFlagsParams.cs
index a391233..43082b8 100644
--- a/src/SchematicHQ.Client/Features/Types/CountFlagsParams.cs
+++ b/src/SchematicHQ.Client/Features/Types/CountFlagsParams.cs
@@ -10,7 +10,7 @@ public class CountFlagsParams
public string? FeatureId { get; init; }
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable? Ids { get; init; }
///
/// Page limit (default 100)
diff --git a/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksParams.cs b/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksParams.cs
index 79a17ec..79608f5 100644
--- a/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksParams.cs
+++ b/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksParams.cs
@@ -10,7 +10,7 @@ public class GetLatestFlagChecksParams
public string? FlagId { get; init; }
[JsonPropertyName("flag_ids")]
- public List? FlagIds { get; init; }
+ public IEnumerable? FlagIds { get; init; }
[JsonPropertyName("id")]
public string? Id { get; init; }
diff --git a/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksResponse.cs b/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksResponse.cs
index a82a0c1..6f80fe2 100644
--- a/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksResponse.cs
+++ b/src/SchematicHQ.Client/Features/Types/GetLatestFlagChecksResponse.cs
@@ -11,7 +11,7 @@ public class GetLatestFlagChecksResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Features/Types/ListAudienceCompaniesResponse.cs b/src/SchematicHQ.Client/Features/Types/ListAudienceCompaniesResponse.cs
index 9235abe..cb6a047 100644
--- a/src/SchematicHQ.Client/Features/Types/ListAudienceCompaniesResponse.cs
+++ b/src/SchematicHQ.Client/Features/Types/ListAudienceCompaniesResponse.cs
@@ -11,7 +11,7 @@ public class ListAudienceCompaniesResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Features/Types/ListAudienceUsersResponse.cs b/src/SchematicHQ.Client/Features/Types/ListAudienceUsersResponse.cs
index 0d94c9c..238dcf7 100644
--- a/src/SchematicHQ.Client/Features/Types/ListAudienceUsersResponse.cs
+++ b/src/SchematicHQ.Client/Features/Types/ListAudienceUsersResponse.cs
@@ -11,7 +11,7 @@ public class ListAudienceUsersResponse
/// The returned resources
///
[JsonPropertyName("data")]
- public List Data { get; init; }
+ public IEnumerable Data { get; init; }
///
/// Input parameters
diff --git a/src/SchematicHQ.Client/Features/Types/ListFeaturesParams.cs b/src/SchematicHQ.Client/Features/Types/ListFeaturesParams.cs
index eb778f3..d6564cf 100644
--- a/src/SchematicHQ.Client/Features/Types/ListFeaturesParams.cs
+++ b/src/SchematicHQ.Client/Features/Types/ListFeaturesParams.cs
@@ -7,7 +7,7 @@ namespace SchematicHQ.Client;
public class ListFeaturesParams
{
[JsonPropertyName("ids")]
- public List? Ids { get; init; }
+ public IEnumerable