Skip to content
Closed
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 116
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-612316c13276a207f56e2e2c7bbc68f4bb73de85e3661595a23f23d9ccc80276.yml
openapi_spec_hash: 6e125f05e40521ec485edf6e15beec2e
config_hash: 8c9a47f104c777e2a1e8f3fad15c093b
configured_endpoints: 118
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-4f31d46f5ba187fc4d702c9f9f1573dacb891edbd086f935707578d7c4f5fed8.yml
openapi_spec_hash: 25b1019f20a47b8af665aae5f8fd0025
config_hash: 5135e9237207028f293049a77428c775
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Changelog

## 0.1.0 (2025-07-30)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/orbcorp/orb-csharp/compare/v0.0.1...v0.1.0)

### Features

* **api:** add C# ([e2db41d](https://github.com/orbcorp/orb-csharp/commit/e2db41d4c0585fc2e3472df2a88a5be4cb2432fb))
* **api:** api update ([b08df82](https://github.com/orbcorp/orb-csharp/commit/b08df824c44e6cc0ac72d42b07c3c089f501862d))
* **api:** api update ([d0d1a79](https://github.com/orbcorp/orb-csharp/commit/d0d1a7995095b23506e98a0ba0e5bdb47370dc5f))
* **api:** api update ([268fdab](https://github.com/orbcorp/orb-csharp/commit/268fdab77f42a6e87ffc2f7fd1863bbd05d30033))
* **api:** api update ([7c7a621](https://github.com/orbcorp/orb-csharp/commit/7c7a621be47edaca08972e0986c72dab410ec052))
* **client:** automatically set constants for user ([25e678a](https://github.com/orbcorp/orb-csharp/commit/25e678a352492d8119389201e754ffa1b96b85a0))
* **client:** implement implicit union casts ([5a6d432](https://github.com/orbcorp/orb-csharp/commit/5a6d4322fd6e82838a22f6658a6252f0c76bf367))
* **client:** improve model names ([df035d1](https://github.com/orbcorp/orb-csharp/commit/df035d1ec73f8ce1226571a18732529a91eba08d))
* **internal:** generate release flow files ([3eb9334](https://github.com/orbcorp/orb-csharp/commit/3eb9334def8a6d9e09154e9c3d606f42897379fa))


### Bug Fixes

* **internal:** prefer to use implicit instantiation when possible ([37366c3](https://github.com/orbcorp/orb-csharp/commit/37366c3e538f3923b5ecdcab2fc5118b348fc19a))


### Chores

* **docs:** clarify beta library limitations in readme ([f4d1b52](https://github.com/orbcorp/orb-csharp/commit/f4d1b5253cdf0e3576547ecf7e78dcdf89b36a00))
* rename some things ([304c45c](https://github.com/orbcorp/orb-csharp/commit/304c45cc17894d6c769b3c8940b3eaf78016eebf))
* use non-aliased `using` ([d670d93](https://github.com/orbcorp/orb-csharp/commit/d670d9359ae682140a6d2972bbde93a516fc27b8))


### Documentation

* note alpha status ([3167be0](https://github.com/orbcorp/orb-csharp/commit/3167be06e8e3929b18e0d4d6af09f69608e68515))
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Orb C# API Library

> [!NOTE]
> The Orb C# API Library is currently in **beta** and we're excited for you to experiment with it!
>
> This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code.
>
> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/orbcorp/orb-csharp/issues/new).

The Orb C# SDK provides convenient access to the [Orb REST API](https://docs.withorb.com/reference/api-reference) from applications written in C#.

The REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference).
Expand All @@ -17,40 +24,40 @@ dotnet add reference /path/to/orb-csharp/src/Orb/
See the [`examples`](examples) directory for complete and runnable examples.

```C#
using Customers = Orb.Models.Customers;
using Orb = Orb;
using System = System;
using Orb;
using Orb.Models.Customers;
using System;

// Configured using the ORB_API_KEY, ORB_WEBHOOK_SECRET and ORB_BASE_URL environment variables
Orb::OrbClient client = new Orb::OrbClient();
OrbClient client = new();

var param = new Customers::CustomerCreateParams()
CustomerCreateParams param = new()
{
Email = "[email protected]", Name = "My Customer"
};

var customer = await client.Customers.Create(param);

System::Console.WriteLine(customer);
Console.WriteLine(customer);
```

## Client Configuration

Configure the client using environment variables:

```C#
using Orb = Orb;
using Orb;

// Configured using the ORB_API_KEY, ORB_WEBHOOK_SECRET and ORB_BASE_URL environment variables
Orb::OrbClient client = new Orb::OrbClient();
OrbClient client = new();
```

Or manually:

```C#
using Orb = Orb;
using Orb;

Orb::OrbClient client = new Orb::OrbClient()
OrbClient client = new()
{
APIKey = "My API Key"
};
Expand Down
23 changes: 12 additions & 11 deletions examples/OrbExample/OrbExample.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\..\src\Orb\Orb.csproj" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>OrbExample</RootNamespace>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\..\src\Orb\Orb.csproj" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>OrbExample</RootNamespace>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>
</Project>
66 changes: 66 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"packages": {
".": {}
},
"$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
"prerelease": true,
"bump-minor-pre-major": true,
"bump-patch-for-minor-pre-major": false,
"pull-request-header": "Automated Release PR",
"pull-request-title-pattern": "release: ${version}",
"changelog-sections": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "chore",
"section": "Chores"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "style",
"section": "Styles"
},
{
"type": "refactor",
"section": "Refactors"
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build System"
},
{
"type": "ci",
"section": "Continuous Integration",
"hidden": true
}
],
"release-type": "simple",
"extra-files": [
"README.md"
]
}
3 changes: 1 addition & 2 deletions src/Orb.Tests/Orb.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
Expand Down
58 changes: 27 additions & 31 deletions src/Orb.Tests/Service/Alerts/AlertServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
using System;
using System.Threading.Tasks;
using AlertCreateForCustomerParamsProperties = Orb.Models.Alerts.AlertCreateForCustomerParamsProperties;
using AlertCreateForExternalCustomerParamsProperties = Orb.Models.Alerts.AlertCreateForExternalCustomerParamsProperties;
using AlertCreateForSubscriptionParamsProperties = Orb.Models.Alerts.AlertCreateForSubscriptionParamsProperties;
using Alerts = Orb.Models.Alerts;
using System = System;
using Tasks = System.Threading.Tasks;
using Tests = Orb.Tests;

namespace Orb.Tests.Service.Alerts;

public class AlertServiceTest : Tests::TestBase
public class AlertServiceTest : TestBase
{
[Fact]
public async Tasks::Task Retrieve_Works()
public async Task Retrieve_Works()
{
var alert = await this.client.Alerts.Retrieve(
new Alerts::AlertRetrieveParams() { AlertID = "alert_id" }
);
var alert = await this.client.Alerts.Retrieve(new() { AlertID = "alert_id" });
alert.Validate();
}

[Fact]
public async Tasks::Task Update_Works()
public async Task Update_Works()
{
var alert = await this.client.Alerts.Update(
new Alerts::AlertUpdateParams()
new()
{
AlertConfigurationID = "alert_configuration_id",
Thresholds = [new Alerts::Threshold() { Value = 0 }],
Thresholds = [new() { Value = 0 }],
}
);
alert.Validate();
}

[Fact]
public async Tasks::Task List_Works()
public async Task List_Works()
{
var page = await this.client.Alerts.List(
new Alerts::AlertListParams()
new()
{
CreatedAtGt = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtGte = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtLt = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtLte = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtGt = DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtGte = DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtLt = DateTime.Parse("2019-12-27T18:11:19.117Z"),
CreatedAtLte = DateTime.Parse("2019-12-27T18:11:19.117Z"),
Cursor = "cursor",
CustomerID = "customer_id",
ExternalCustomerID = "external_customer_id",
Expand All @@ -53,43 +49,43 @@ public class AlertServiceTest : Tests::TestBase
}

[Fact]
public async Tasks::Task CreateForCustomer_Works()
public async Task CreateForCustomer_Works()
{
var alert = await this.client.Alerts.CreateForCustomer(
new Alerts::AlertCreateForCustomerParams()
new()
{
CustomerID = "customer_id",
Currency = "currency",
Type = AlertCreateForCustomerParamsProperties::Type.CreditBalanceDepleted,
Thresholds = [new Alerts::Threshold() { Value = 0 }],
Thresholds = [new() { Value = 0 }],
}
);
alert.Validate();
}

[Fact]
public async Tasks::Task CreateForExternalCustomer_Works()
public async Task CreateForExternalCustomer_Works()
{
var alert = await this.client.Alerts.CreateForExternalCustomer(
new Alerts::AlertCreateForExternalCustomerParams()
new()
{
ExternalCustomerID = "external_customer_id",
Currency = "currency",
Type = AlertCreateForExternalCustomerParamsProperties::Type.CreditBalanceDepleted,
Thresholds = [new Alerts::Threshold() { Value = 0 }],
Thresholds = [new() { Value = 0 }],
}
);
alert.Validate();
}

[Fact]
public async Tasks::Task CreateForSubscription_Works()
public async Task CreateForSubscription_Works()
{
var alert = await this.client.Alerts.CreateForSubscription(
new Alerts::AlertCreateForSubscriptionParams()
new()
{
SubscriptionID = "subscription_id",
Thresholds = [new Alerts::Threshold() { Value = 0 }],
Thresholds = [new() { Value = 0 }],
Type = AlertCreateForSubscriptionParamsProperties::Type.UsageExceeded,
MetricID = "metric_id",
}
Expand All @@ -98,10 +94,10 @@ public class AlertServiceTest : Tests::TestBase
}

[Fact]
public async Tasks::Task Disable_Works()
public async Task Disable_Works()
{
var alert = await this.client.Alerts.Disable(
new Alerts::AlertDisableParams()
new()
{
AlertConfigurationID = "alert_configuration_id",
SubscriptionID = "subscription_id",
Expand All @@ -111,10 +107,10 @@ public class AlertServiceTest : Tests::TestBase
}

[Fact]
public async Tasks::Task Enable_Works()
public async Task Enable_Works()
{
var alert = await this.client.Alerts.Enable(
new Alerts::AlertEnableParams()
new()
{
AlertConfigurationID = "alert_configuration_id",
SubscriptionID = "subscription_id",
Expand Down
Loading
Loading