Skip to content

Commit d670d93

Browse files
chore: use non-aliased using
1 parent 37366c3 commit d670d93

File tree

1,330 files changed

+32356
-43595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,330 files changed

+32356
-43595
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,40 +22,40 @@ dotnet add reference /path/to/orb-csharp/src/Orb/
2222
See the [`examples`](examples) directory for complete and runnable examples.
2323

2424
```C#
25-
using Customers = Orb.Models.Customers;
26-
using Orb = Orb;
27-
using System = System;
25+
using Orb;
26+
using Orb.Models.Customers;
27+
using System;
2828

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

32-
Customers::CustomerCreateParams param = new()
32+
CustomerCreateParams param = new()
3333
{
3434
Email = "[email protected]", Name = "My Customer"
3535
};
3636

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

39-
System::Console.WriteLine(customer);
39+
Console.WriteLine(customer);
4040
```
4141

4242
## Client Configuration
4343

4444
Configure the client using environment variables:
4545

4646
```C#
47-
using Orb = Orb;
47+
using Orb;
4848

4949
// Configured using the ORB_API_KEY, ORB_WEBHOOK_SECRET and ORB_BASE_URL environment variables
50-
Orb::OrbClient client = new();
50+
OrbClient client = new();
5151
```
5252

5353
Or manually:
5454

5555
```C#
56-
using Orb = Orb;
56+
using Orb;
5757

58-
Orb::OrbClient client = new()
58+
OrbClient client = new()
5959
{
6060
APIKey = "My API Key"
6161
};
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
<ItemGroup>
3-
<ProjectReference Include="..\..\src\Orb\Orb.csproj" />
4-
</ItemGroup>
5-
<PropertyGroup>
6-
<OutputType>Exe</OutputType>
7-
<TargetFramework>net8.0</TargetFramework>
8-
<RootNamespace>OrbExample</RootNamespace>
9-
<Nullable>enable</Nullable>
10-
</PropertyGroup>
11-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\..\src\Orb\Orb.csproj" />
4+
</ItemGroup>
5+
<PropertyGroup>
6+
<OutputType>Exe</OutputType>
7+
<TargetFramework>net8.0</TargetFramework>
8+
<RootNamespace>OrbExample</RootNamespace>
9+
<Nullable>enable</Nullable>
10+
<ImplicitUsings>disable</ImplicitUsings>
11+
</PropertyGroup>
12+
</Project>

src/Orb.Tests/Orb.Tests.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
4-
<ImplicitUsings>enable</ImplicitUsings>
5-
<Nullable>enable</Nullable>
64
<IsPackable>false</IsPackable>
75
<IsTestProject>true</IsTestProject>
6+
<ImplicitUsings>disable</ImplicitUsings>
87
</PropertyGroup>
98
<ItemGroup>
109
<PackageReference Include="coverlet.collector" Version="6.0.0" />

src/Orb.Tests/Service/Alerts/AlertServiceTest.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1+
using System;
2+
using System.Threading.Tasks;
13
using AlertCreateForCustomerParamsProperties = Orb.Models.Alerts.AlertCreateForCustomerParamsProperties;
24
using AlertCreateForExternalCustomerParamsProperties = Orb.Models.Alerts.AlertCreateForExternalCustomerParamsProperties;
35
using AlertCreateForSubscriptionParamsProperties = Orb.Models.Alerts.AlertCreateForSubscriptionParamsProperties;
4-
using System = System;
5-
using Tasks = System.Threading.Tasks;
6-
using Tests = Orb.Tests;
76

87
namespace Orb.Tests.Service.Alerts;
98

10-
public class AlertServiceTest : Tests::TestBase
9+
public class AlertServiceTest : TestBase
1110
{
1211
[Fact]
13-
public async Tasks::Task Retrieve_Works()
12+
public async Task Retrieve_Works()
1413
{
1514
var alert = await this.client.Alerts.Retrieve(new() { AlertID = "alert_id" });
1615
alert.Validate();
1716
}
1817

1918
[Fact]
20-
public async Tasks::Task Update_Works()
19+
public async Task Update_Works()
2120
{
2221
var alert = await this.client.Alerts.Update(
2322
new()
@@ -30,15 +29,15 @@ public class AlertServiceTest : Tests::TestBase
3029
}
3130

3231
[Fact]
33-
public async Tasks::Task List_Works()
32+
public async Task List_Works()
3433
{
3534
var page = await this.client.Alerts.List(
3635
new()
3736
{
38-
CreatedAtGt = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
39-
CreatedAtGte = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
40-
CreatedAtLt = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
41-
CreatedAtLte = System::DateTime.Parse("2019-12-27T18:11:19.117Z"),
37+
CreatedAtGt = DateTime.Parse("2019-12-27T18:11:19.117Z"),
38+
CreatedAtGte = DateTime.Parse("2019-12-27T18:11:19.117Z"),
39+
CreatedAtLt = DateTime.Parse("2019-12-27T18:11:19.117Z"),
40+
CreatedAtLte = DateTime.Parse("2019-12-27T18:11:19.117Z"),
4241
Cursor = "cursor",
4342
CustomerID = "customer_id",
4443
ExternalCustomerID = "external_customer_id",
@@ -50,7 +49,7 @@ public class AlertServiceTest : Tests::TestBase
5049
}
5150

5251
[Fact]
53-
public async Tasks::Task CreateForCustomer_Works()
52+
public async Task CreateForCustomer_Works()
5453
{
5554
var alert = await this.client.Alerts.CreateForCustomer(
5655
new()
@@ -65,7 +64,7 @@ public class AlertServiceTest : Tests::TestBase
6564
}
6665

6766
[Fact]
68-
public async Tasks::Task CreateForExternalCustomer_Works()
67+
public async Task CreateForExternalCustomer_Works()
6968
{
7069
var alert = await this.client.Alerts.CreateForExternalCustomer(
7170
new()
@@ -80,7 +79,7 @@ public class AlertServiceTest : Tests::TestBase
8079
}
8180

8281
[Fact]
83-
public async Tasks::Task CreateForSubscription_Works()
82+
public async Task CreateForSubscription_Works()
8483
{
8584
var alert = await this.client.Alerts.CreateForSubscription(
8685
new()
@@ -95,7 +94,7 @@ public class AlertServiceTest : Tests::TestBase
9594
}
9695

9796
[Fact]
98-
public async Tasks::Task Disable_Works()
97+
public async Task Disable_Works()
9998
{
10099
var alert = await this.client.Alerts.Disable(
101100
new()
@@ -108,7 +107,7 @@ public class AlertServiceTest : Tests::TestBase
108107
}
109108

110109
[Fact]
111-
public async Tasks::Task Enable_Works()
110+
public async Task Enable_Works()
112111
{
113112
var alert = await this.client.Alerts.Enable(
114113
new()

src/Orb.Tests/Service/Beta/BetaServiceTest.cs

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
using CustomExpirationProperties = Orb.Models.CustomExpirationProperties;
2-
using Models = Orb.Models;
3-
using NewAllocationPriceProperties = Orb.Models.NewAllocationPriceProperties;
1+
using System.Threading.Tasks;
2+
using Orb.Models;
3+
using Orb.Models.CustomExpirationProperties;
4+
using Orb.Models.NewAllocationPriceProperties;
5+
using Orb.Models.NewPercentageDiscountProperties;
6+
using Orb.Models.TransformPriceFilterProperties;
7+
using Orb.Models.UnitConversionRateConfigProperties;
48
using NewBillingCycleConfigurationProperties = Orb.Models.NewBillingCycleConfigurationProperties;
5-
using NewPercentageDiscountProperties = Orb.Models.NewPercentageDiscountProperties;
69
using NewPlanUnitPriceProperties = Orb.Models.NewPlanUnitPriceProperties;
7-
using Tasks = System.Threading.Tasks;
8-
using Tests = Orb.Tests;
9-
using TransformPriceFilterProperties = Orb.Models.TransformPriceFilterProperties;
10-
using UnitConversionRateConfigProperties = Orb.Models.UnitConversionRateConfigProperties;
1110

1211
namespace Orb.Tests.Service.Beta;
1312

14-
public class BetaServiceTest : Tests::TestBase
13+
public class BetaServiceTest : TestBase
1514
{
1615
[Fact]
17-
public async Tasks::Task CreatePlanVersion_Works()
16+
public async Task CreatePlanVersion_Works()
1817
{
1918
var planVersion = await this.client.Beta.CreatePlanVersion(
2019
new()
@@ -25,26 +24,25 @@ public class BetaServiceTest : Tests::TestBase
2524
[
2625
new()
2726
{
28-
Adjustment = new Models::NewPercentageDiscount()
27+
Adjustment = new NewPercentageDiscount()
2928
{
30-
AdjustmentType =
31-
NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount,
29+
AdjustmentType = AdjustmentType.PercentageDiscount,
3230
PercentageDiscount = 0,
33-
AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True,
31+
AppliesToAll = AppliesToAll.True,
3432
AppliesToItemIDs = ["item_1", "item_2"],
3533
AppliesToPriceIDs = ["price_1", "price_2"],
3634
Currency = "currency",
3735
Filters =
3836
[
3937
new()
4038
{
41-
Field = TransformPriceFilterProperties::Field.PriceID,
42-
Operator = TransformPriceFilterProperties::Operator.Includes,
39+
Field = Field.PriceID,
40+
Operator = Operator.Includes,
4341
Values = ["string"],
4442
},
4543
],
4644
IsInvoiceLevel = true,
47-
PriceType = NewPercentageDiscountProperties::PriceType.Usage,
45+
PriceType = PriceType.Usage,
4846
},
4947
PlanPhaseOrder = 0,
5048
},
@@ -56,17 +54,17 @@ public class BetaServiceTest : Tests::TestBase
5654
AllocationPrice = new()
5755
{
5856
Amount = "10.00",
59-
Cadence = NewAllocationPriceProperties::Cadence.Monthly,
57+
Cadence = Cadence.Monthly,
6058
Currency = "USD",
6159
CustomExpiration = new()
6260
{
6361
Duration = 0,
64-
DurationUnit = CustomExpirationProperties::DurationUnit.Day,
62+
DurationUnit = DurationUnit.Day,
6563
},
6664
ExpiresAtEndOfCadence = true,
6765
},
6866
PlanPhaseOrder = 0,
69-
Price = new Models::NewPlanUnitPrice()
67+
Price = new NewPlanUnitPrice()
7068
{
7169
Cadence = NewPlanUnitPriceProperties::Cadence.Annual,
7270
ItemID = "item_id",
@@ -82,10 +80,9 @@ public class BetaServiceTest : Tests::TestBase
8280
NewBillingCycleConfigurationProperties::DurationUnit.Day,
8381
},
8482
ConversionRate = 0,
85-
ConversionRateConfig = new Models::UnitConversionRateConfig()
83+
ConversionRateConfig = new UnitConversionRateConfig()
8684
{
87-
ConversionRateType =
88-
UnitConversionRateConfigProperties::ConversionRateType.Unit,
85+
ConversionRateType = ConversionRateType.Unit,
8986
UnitConfig = new() { UnitAmount = "unit_amount" },
9087
},
9188
Currency = "currency",
@@ -116,26 +113,25 @@ public class BetaServiceTest : Tests::TestBase
116113
[
117114
new()
118115
{
119-
Adjustment = new Models::NewPercentageDiscount()
116+
Adjustment = new NewPercentageDiscount()
120117
{
121-
AdjustmentType =
122-
NewPercentageDiscountProperties::AdjustmentType.PercentageDiscount,
118+
AdjustmentType = AdjustmentType.PercentageDiscount,
123119
PercentageDiscount = 0,
124-
AppliesToAll = NewPercentageDiscountProperties::AppliesToAll.True,
120+
AppliesToAll = AppliesToAll.True,
125121
AppliesToItemIDs = ["item_1", "item_2"],
126122
AppliesToPriceIDs = ["price_1", "price_2"],
127123
Currency = "currency",
128124
Filters =
129125
[
130126
new()
131127
{
132-
Field = TransformPriceFilterProperties::Field.PriceID,
133-
Operator = TransformPriceFilterProperties::Operator.Includes,
128+
Field = Field.PriceID,
129+
Operator = Operator.Includes,
134130
Values = ["string"],
135131
},
136132
],
137133
IsInvoiceLevel = true,
138-
PriceType = NewPercentageDiscountProperties::PriceType.Usage,
134+
PriceType = PriceType.Usage,
139135
},
140136
ReplacesAdjustmentID = "replaces_adjustment_id",
141137
PlanPhaseOrder = 0,
@@ -149,17 +145,17 @@ public class BetaServiceTest : Tests::TestBase
149145
AllocationPrice = new()
150146
{
151147
Amount = "10.00",
152-
Cadence = NewAllocationPriceProperties::Cadence.Monthly,
148+
Cadence = Cadence.Monthly,
153149
Currency = "USD",
154150
CustomExpiration = new()
155151
{
156152
Duration = 0,
157-
DurationUnit = CustomExpirationProperties::DurationUnit.Day,
153+
DurationUnit = DurationUnit.Day,
158154
},
159155
ExpiresAtEndOfCadence = true,
160156
},
161157
PlanPhaseOrder = 0,
162-
Price = new Models::NewPlanUnitPrice()
158+
Price = new NewPlanUnitPrice()
163159
{
164160
Cadence = NewPlanUnitPriceProperties::Cadence.Annual,
165161
ItemID = "item_id",
@@ -175,10 +171,9 @@ public class BetaServiceTest : Tests::TestBase
175171
NewBillingCycleConfigurationProperties::DurationUnit.Day,
176172
},
177173
ConversionRate = 0,
178-
ConversionRateConfig = new Models::UnitConversionRateConfig()
174+
ConversionRateConfig = new UnitConversionRateConfig()
179175
{
180-
ConversionRateType =
181-
UnitConversionRateConfigProperties::ConversionRateType.Unit,
176+
ConversionRateType = ConversionRateType.Unit,
182177
UnitConfig = new() { UnitAmount = "unit_amount" },
183178
},
184179
Currency = "currency",
@@ -210,7 +205,7 @@ public class BetaServiceTest : Tests::TestBase
210205
}
211206

212207
[Fact]
213-
public async Tasks::Task FetchPlanVersion_Works()
208+
public async Task FetchPlanVersion_Works()
214209
{
215210
var planVersion = await this.client.Beta.FetchPlanVersion(
216211
new() { PlanID = "plan_id", Version = "version" }
@@ -219,7 +214,7 @@ public class BetaServiceTest : Tests::TestBase
219214
}
220215

221216
[Fact]
222-
public async Tasks::Task SetDefaultPlanVersion_Works()
217+
public async Task SetDefaultPlanVersion_Works()
223218
{
224219
var plan = await this.client.Beta.SetDefaultPlanVersion(
225220
new() { PlanID = "plan_id", Version = 0 }

0 commit comments

Comments
 (0)