Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8,680 changes: 8,680 additions & 0 deletions reference.md

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/SchematicHQ.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{084B307E-7E57-4DFB-8014-A8C4FEB52D22}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client", "SchematicHQ.Client\SchematicHQ.Client.csproj", "{DD0FB689-EF1F-421E-9E0B-ED27B0CE542E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{51A0E61F-CC06-4341-A825-C10A8EB40049}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicHQ.Client.Test", "SchematicHQ.Client.Test\SchematicHQ.Client.Test.csproj", "{D9BDB459-32CD-4F46-AE1B-8DEB50DFEE16}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -16,13 +16,13 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{084B307E-7E57-4DFB-8014-A8C4FEB52D22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{084B307E-7E57-4DFB-8014-A8C4FEB52D22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{084B307E-7E57-4DFB-8014-A8C4FEB52D22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{084B307E-7E57-4DFB-8014-A8C4FEB52D22}.Release|Any CPU.Build.0 = Release|Any CPU
{51A0E61F-CC06-4341-A825-C10A8EB40049}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{51A0E61F-CC06-4341-A825-C10A8EB40049}.Debug|Any CPU.Build.0 = Debug|Any CPU
{51A0E61F-CC06-4341-A825-C10A8EB40049}.Release|Any CPU.ActiveCfg = Release|Any CPU
{51A0E61F-CC06-4341-A825-C10A8EB40049}.Release|Any CPU.Build.0 = Release|Any CPU
{DD0FB689-EF1F-421E-9E0B-ED27B0CE542E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD0FB689-EF1F-421E-9E0B-ED27B0CE542E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD0FB689-EF1F-421E-9E0B-ED27B0CE542E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD0FB689-EF1F-421E-9E0B-ED27B0CE542E}.Release|Any CPU.Build.0 = Release|Any CPU
{D9BDB459-32CD-4F46-AE1B-8DEB50DFEE16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9BDB459-32CD-4F46-AE1B-8DEB50DFEE16}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9BDB459-32CD-4F46-AE1B-8DEB50DFEE16}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9BDB459-32CD-4F46-AE1B-8DEB50DFEE16}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
44 changes: 39 additions & 5 deletions src/SchematicHQ.Client/Accounts/AccountsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ internal AccountsClient(RawClient client)
}

/// <example><code>
/// await client.Accounts.ListApiKeysAsync(new ListApiKeysRequest { RequireEnvironment = true });
/// await client.Accounts.ListApiKeysAsync(
/// new ListApiKeysRequest
/// {
/// EnvironmentId = "environment_id",
/// RequireEnvironment = true,
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListApiKeysResponse> ListApiKeysAsync(
ListApiKeysRequest request,
Expand Down Expand Up @@ -372,7 +380,15 @@ public async Task<DeleteApiKeyResponse> DeleteApiKeyAsync(
}

/// <example><code>
/// await client.Accounts.CountApiKeysAsync(new CountApiKeysRequest { RequireEnvironment = true });
/// await client.Accounts.CountApiKeysAsync(
/// new CountApiKeysRequest
/// {
/// EnvironmentId = "environment_id",
/// RequireEnvironment = true,
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<CountApiKeysResponse> CountApiKeysAsync(
CountApiKeysRequest request,
Expand Down Expand Up @@ -453,7 +469,16 @@ public async Task<CountApiKeysResponse> CountApiKeysAsync(
}

/// <example><code>
/// await client.Accounts.ListApiRequestsAsync(new ListApiRequestsRequest());
/// await client.Accounts.ListApiRequestsAsync(
/// new ListApiRequestsRequest
/// {
/// Q = "q",
/// RequestType = "request_type",
/// EnvironmentId = "environment_id",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListApiRequestsResponse> ListApiRequestsAsync(
ListApiRequestsRequest request,
Expand Down Expand Up @@ -608,7 +633,16 @@ public async Task<GetApiRequestResponse> GetApiRequestAsync(
}

/// <example><code>
/// await client.Accounts.CountApiRequestsAsync(new CountApiRequestsRequest());
/// await client.Accounts.CountApiRequestsAsync(
/// new CountApiRequestsRequest
/// {
/// Q = "q",
/// RequestType = "request_type",
/// EnvironmentId = "environment_id",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<CountApiRequestsResponse> CountApiRequestsAsync(
CountApiRequestsRequest request,
Expand Down Expand Up @@ -696,7 +730,7 @@ public async Task<CountApiRequestsResponse> CountApiRequestsAsync(
}

/// <example><code>
/// await client.Accounts.ListEnvironmentsAsync(new ListEnvironmentsRequest());
/// await client.Accounts.ListEnvironmentsAsync(new ListEnvironmentsRequest { Limit = 1, Offset = 1 });
/// </code></example>
public async Task<ListEnvironmentsResponse> ListEnvironmentsAsync(
ListEnvironmentsRequest request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public record ListApiKeysResponse : IJsonOnDeserialized
private readonly IDictionary<string, JsonElement> _extensionData =
new Dictionary<string, JsonElement>();

/// <summary>
/// The returned resources
/// </summary>
[JsonPropertyName("data")]
public IEnumerable<ApiKeyResponseData> Data { get; set; } = new List<ApiKeyResponseData>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public record ListApiRequestsResponse : IJsonOnDeserialized
private readonly IDictionary<string, JsonElement> _extensionData =
new Dictionary<string, JsonElement>();

/// <summary>
/// The returned resources
/// </summary>
[JsonPropertyName("data")]
public IEnumerable<ApiKeyRequestListResponseData> Data { get; set; } =
new List<ApiKeyRequestListResponseData>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ public record ListEnvironmentsResponse : IJsonOnDeserialized
private readonly IDictionary<string, JsonElement> _extensionData =
new Dictionary<string, JsonElement>();

/// <summary>
/// The returned resources
/// </summary>
[JsonPropertyName("data")]
public IEnumerable<EnvironmentResponseData> Data { get; set; } =
new List<EnvironmentResponseData>();
Expand Down
149 changes: 132 additions & 17 deletions src/SchematicHQ.Client/Billing/BillingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ internal BillingClient(RawClient client)
}

/// <example><code>
/// await client.Billing.ListCouponsAsync(new ListCouponsRequest());
/// await client.Billing.ListCouponsAsync(
/// new ListCouponsRequest
/// {
/// IsActive = true,
/// Q = "q",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListCouponsResponse> ListCouponsAsync(
ListCouponsRequest request,
Expand Down Expand Up @@ -257,7 +265,14 @@ public async Task<UpsertBillingCustomerResponse> UpsertBillingCustomerAsync(

/// <example><code>
/// await client.Billing.ListCustomersWithSubscriptionsAsync(
/// new ListCustomersWithSubscriptionsRequest()
/// new ListCustomersWithSubscriptionsRequest
/// {
/// Name = "name",
/// FailedToImport = true,
/// Q = "q",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListCustomersWithSubscriptionsResponse> ListCustomersWithSubscriptionsAsync(
Expand Down Expand Up @@ -347,7 +362,16 @@ public async Task<ListCustomersWithSubscriptionsResponse> ListCustomersWithSubsc
}

/// <example><code>
/// await client.Billing.CountCustomersAsync(new CountCustomersRequest());
/// await client.Billing.CountCustomersAsync(
/// new CountCustomersRequest
/// {
/// Name = "name",
/// FailedToImport = true,
/// Q = "q",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<CountCustomersResponse> CountCustomersAsync(
CountCustomersRequest request,
Expand Down Expand Up @@ -439,8 +463,11 @@ public async Task<CountCustomersResponse> CountCustomersAsync(
/// await client.Billing.ListInvoicesAsync(
/// new ListInvoicesRequest
/// {
/// CompanyId = "company_id",
/// CustomerExternalId = "customer_external_id",
/// SubscriptionExternalId = "subscription_external_id",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
Expand Down Expand Up @@ -603,7 +630,14 @@ public async Task<UpsertInvoiceResponse> UpsertInvoiceAsync(
}

/// <example><code>
/// await client.Billing.ListMetersAsync(new ListMetersRequest());
/// await client.Billing.ListMetersAsync(
/// new ListMetersRequest
/// {
/// DisplayName = "display_name",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListMetersResponse> ListMetersAsync(
ListMetersRequest request,
Expand Down Expand Up @@ -760,7 +794,13 @@ public async Task<UpsertBillingMeterResponse> UpsertBillingMeterAsync(

/// <example><code>
/// await client.Billing.ListPaymentMethodsAsync(
/// new ListPaymentMethodsRequest { CustomerExternalId = "customer_external_id" }
/// new ListPaymentMethodsRequest
/// {
/// CompanyId = "company_id",
/// CustomerExternalId = "customer_external_id",
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListPaymentMethodsResponse> ListPaymentMethodsAsync(
Expand Down Expand Up @@ -917,7 +957,22 @@ public async Task<UpsertPaymentMethodResponse> UpsertPaymentMethodAsync(
}

/// <example><code>
/// await client.Billing.SearchBillingPricesAsync(new SearchBillingPricesRequest());
/// await client.Billing.SearchBillingPricesAsync(
/// new SearchBillingPricesRequest
/// {
/// ForInitialPlan = true,
/// ForTrialExpiryPlan = true,
/// ProductId = "product_id",
/// Interval = "interval",
/// Price = 1,
/// Q = "q",
/// RequiresPaymentMethod = true,
/// TiersMode = SearchBillingPricesRequestTiersMode.Volume,
/// UsageType = SearchBillingPricesRequestUsageType.Licensed,
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<SearchBillingPricesResponse> SearchBillingPricesAsync(
SearchBillingPricesRequest request,
Expand All @@ -927,26 +982,44 @@ public async Task<SearchBillingPricesResponse> SearchBillingPricesAsync(
{
var _query = new Dictionary<string, object>();
_query["ids"] = request.Ids;
if (request.Q != null)
if (request.ForInitialPlan != null)
{
_query["q"] = request.Q;
_query["for_initial_plan"] = JsonUtils.Serialize(request.ForInitialPlan.Value);
}
if (request.Interval != null)
if (request.ForTrialExpiryPlan != null)
{
_query["interval"] = request.Interval;
_query["for_trial_expiry_plan"] = JsonUtils.Serialize(request.ForTrialExpiryPlan.Value);
}
if (request.UsageType != null)
if (request.ProductId != null)
{
_query["usage_type"] = request.UsageType.Value.Stringify();
_query["product_id"] = request.ProductId;
}
if (request.Interval != null)
{
_query["interval"] = request.Interval;
}
if (request.Price != null)
{
_query["price"] = request.Price.Value.ToString();
}
if (request.Q != null)
{
_query["q"] = request.Q;
}
if (request.RequiresPaymentMethod != null)
{
_query["requires_payment_method"] = JsonUtils.Serialize(
request.RequiresPaymentMethod.Value
);
}
if (request.TiersMode != null)
{
_query["tiers_mode"] = request.TiersMode.Value.Stringify();
}
if (request.UsageType != null)
{
_query["usage_type"] = request.UsageType.Value.Stringify();
}
if (request.Limit != null)
{
_query["limit"] = request.Limit.Value.ToString();
Expand Down Expand Up @@ -1168,7 +1241,21 @@ public async Task<DeleteBillingProductResponse> DeleteBillingProductAsync(
}

/// <example><code>
/// await client.Billing.ListProductPricesAsync(new ListProductPricesRequest());
/// await client.Billing.ListProductPricesAsync(
/// new ListProductPricesRequest
/// {
/// Name = "name",
/// Q = "q",
/// PriceUsageType = ListProductPricesRequestPriceUsageType.Licensed,
/// WithoutLinkedToPlan = true,
/// WithOneTimeCharges = true,
/// WithZeroPrice = true,
/// WithPricesOnly = true,
/// IsActive = true,
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListProductPricesResponse> ListProductPricesAsync(
ListProductPricesRequest request,
Expand Down Expand Up @@ -1423,7 +1510,21 @@ public async Task<UpsertBillingProductResponse> UpsertBillingProductAsync(
}

/// <example><code>
/// await client.Billing.ListBillingProductsAsync(new ListBillingProductsRequest());
/// await client.Billing.ListBillingProductsAsync(
/// new ListBillingProductsRequest
/// {
/// Name = "name",
/// Q = "q",
/// PriceUsageType = ListBillingProductsRequestPriceUsageType.Licensed,
/// WithoutLinkedToPlan = true,
/// WithOneTimeCharges = true,
/// WithZeroPrice = true,
/// WithPricesOnly = true,
/// IsActive = true,
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<ListBillingProductsResponse> ListBillingProductsAsync(
ListBillingProductsRequest request,
Expand Down Expand Up @@ -1534,7 +1635,21 @@ public async Task<ListBillingProductsResponse> ListBillingProductsAsync(
}

/// <example><code>
/// await client.Billing.CountBillingProductsAsync(new CountBillingProductsRequest());
/// await client.Billing.CountBillingProductsAsync(
/// new CountBillingProductsRequest
/// {
/// Name = "name",
/// Q = "q",
/// PriceUsageType = CountBillingProductsRequestPriceUsageType.Licensed,
/// WithoutLinkedToPlan = true,
/// WithOneTimeCharges = true,
/// WithZeroPrice = true,
/// WithPricesOnly = true,
/// IsActive = true,
/// Limit = 1,
/// Offset = 1,
/// }
/// );
/// </code></example>
public async Task<CountBillingProductsResponse> CountBillingProductsAsync(
CountBillingProductsRequest request,
Expand Down Expand Up @@ -1646,7 +1761,7 @@ public async Task<CountBillingProductsResponse> CountBillingProductsAsync(

/// <example><code>
/// await client.Billing.UpsertBillingSubscriptionAsync(
/// new CreateBillingSubscriptionsRequestBody
/// new CreateBillingSubscriptionRequestBody
/// {
/// CancelAtPeriodEnd = true,
/// Currency = "currency",
Expand Down Expand Up @@ -1681,7 +1796,7 @@ public async Task<CountBillingProductsResponse> CountBillingProductsAsync(
/// );
/// </code></example>
public async Task<UpsertBillingSubscriptionResponse> UpsertBillingSubscriptionAsync(
CreateBillingSubscriptionsRequestBody request,
CreateBillingSubscriptionRequestBody request,
RequestOptions? options = null,
CancellationToken cancellationToken = default
)
Expand Down
Loading
Loading