Skip to content

Commit 965ec12

Browse files
feat(client): additional methods for positional params
1 parent 7ca3eea commit 965ec12

File tree

162 files changed

+3903
-279
lines changed

Some content is hidden

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

162 files changed

+3903
-279
lines changed

src/Orb.Tests/Services/AlertServiceTest.cs

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ public class AlertServiceTest : TestBase
88
[Fact]
99
public async Task Retrieve_Works()
1010
{
11-
var alert = await this.client.Alerts.Retrieve(new() { AlertID = "alert_id" });
11+
var alert = await this.client.Alerts.Retrieve("alert_id");
1212
alert.Validate();
1313
}
1414

1515
[Fact]
1616
public async Task Update_Works()
1717
{
1818
var alert = await this.client.Alerts.Update(
19-
new() { AlertConfigurationID = "alert_configuration_id", Thresholds = [new(0)] }
19+
"alert_configuration_id",
20+
new() { Thresholds = [new(0)] }
2021
);
2122
alert.Validate();
2223
}
@@ -32,12 +33,8 @@ public async Task List_Works()
3233
public async Task CreateForCustomer_Works()
3334
{
3435
var alert = await this.client.Alerts.CreateForCustomer(
35-
new()
36-
{
37-
CustomerID = "customer_id",
38-
Currency = "currency",
39-
Type = Type.CreditBalanceDepleted,
40-
}
36+
"customer_id",
37+
new() { Currency = "currency", Type = Type.CreditBalanceDepleted }
4138
);
4239
alert.Validate();
4340
}
@@ -46,12 +43,8 @@ public async Task CreateForCustomer_Works()
4643
public async Task CreateForExternalCustomer_Works()
4744
{
4845
var alert = await this.client.Alerts.CreateForExternalCustomer(
49-
new()
50-
{
51-
ExternalCustomerID = "external_customer_id",
52-
Currency = "currency",
53-
Type = TypeModel.CreditBalanceDepleted,
54-
}
46+
"external_customer_id",
47+
new() { Currency = "currency", Type = TypeModel.CreditBalanceDepleted }
5548
);
5649
alert.Validate();
5750
}
@@ -60,31 +53,23 @@ public async Task CreateForExternalCustomer_Works()
6053
public async Task CreateForSubscription_Works()
6154
{
6255
var alert = await this.client.Alerts.CreateForSubscription(
63-
new()
64-
{
65-
SubscriptionID = "subscription_id",
66-
Thresholds = [new(0)],
67-
Type = Type1.UsageExceeded,
68-
}
56+
"subscription_id",
57+
new() { Thresholds = [new(0)], Type = Type1.UsageExceeded }
6958
);
7059
alert.Validate();
7160
}
7261

7362
[Fact]
7463
public async Task Disable_Works()
7564
{
76-
var alert = await this.client.Alerts.Disable(
77-
new() { AlertConfigurationID = "alert_configuration_id" }
78-
);
65+
var alert = await this.client.Alerts.Disable("alert_configuration_id");
7966
alert.Validate();
8067
}
8168

8269
[Fact]
8370
public async Task Enable_Works()
8471
{
85-
var alert = await this.client.Alerts.Enable(
86-
new() { AlertConfigurationID = "alert_configuration_id" }
87-
);
72+
var alert = await this.client.Alerts.Enable("alert_configuration_id");
8873
alert.Validate();
8974
}
9075
}

src/Orb.Tests/Services/Beta/ExternalPlanIDServiceTest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public class ExternalPlanIDServiceTest : TestBase
88
public async Task CreatePlanVersion_Works()
99
{
1010
var planVersion = await this.client.Beta.ExternalPlanID.CreatePlanVersion(
11-
new() { ExternalPlanID = "external_plan_id", Version = 0 }
11+
"external_plan_id",
12+
new() { Version = 0 }
1213
);
1314
planVersion.Validate();
1415
}
@@ -17,7 +18,8 @@ public async Task CreatePlanVersion_Works()
1718
public async Task FetchPlanVersion_Works()
1819
{
1920
var planVersion = await this.client.Beta.ExternalPlanID.FetchPlanVersion(
20-
new() { ExternalPlanID = "external_plan_id", Version = "version" }
21+
"version",
22+
new() { ExternalPlanID = "external_plan_id" }
2123
);
2224
planVersion.Validate();
2325
}
@@ -26,7 +28,8 @@ public async Task FetchPlanVersion_Works()
2628
public async Task SetDefaultPlanVersion_Works()
2729
{
2830
var plan = await this.client.Beta.ExternalPlanID.SetDefaultPlanVersion(
29-
new() { ExternalPlanID = "external_plan_id", Version = 0 }
31+
"external_plan_id",
32+
new() { Version = 0 }
3033
);
3134
plan.Validate();
3235
}

src/Orb.Tests/Services/BetaServiceTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public class BetaServiceTest : TestBase
88
public async Task CreatePlanVersion_Works()
99
{
1010
var planVersion = await this.client.Beta.CreatePlanVersion(
11-
new() { PlanID = "plan_id", Version = 0 }
11+
"plan_id",
12+
new() { Version = 0 }
1213
);
1314
planVersion.Validate();
1415
}
@@ -17,17 +18,16 @@ public async Task CreatePlanVersion_Works()
1718
public async Task FetchPlanVersion_Works()
1819
{
1920
var planVersion = await this.client.Beta.FetchPlanVersion(
20-
new() { PlanID = "plan_id", Version = "version" }
21+
"version",
22+
new() { PlanID = "plan_id" }
2123
);
2224
planVersion.Validate();
2325
}
2426

2527
[Fact]
2628
public async Task SetDefaultPlanVersion_Works()
2729
{
28-
var plan = await this.client.Beta.SetDefaultPlanVersion(
29-
new() { PlanID = "plan_id", Version = 0 }
30-
);
30+
var plan = await this.client.Beta.SetDefaultPlanVersion("plan_id", new() { Version = 0 });
3131
plan.Validate();
3232
}
3333
}

src/Orb.Tests/Services/CouponServiceTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public async Task List_Works()
2424
[Fact]
2525
public async Task Archive_Works()
2626
{
27-
var coupon = await this.client.Coupons.Archive(new() { CouponID = "coupon_id" });
27+
var coupon = await this.client.Coupons.Archive("coupon_id");
2828
coupon.Validate();
2929
}
3030

3131
[Fact]
3232
public async Task Fetch_Works()
3333
{
34-
var coupon = await this.client.Coupons.Fetch(new() { CouponID = "coupon_id" });
34+
var coupon = await this.client.Coupons.Fetch("coupon_id");
3535
coupon.Validate();
3636
}
3737
}

src/Orb.Tests/Services/Coupons/SubscriptionServiceTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class SubscriptionServiceTest : TestBase
77
[Fact]
88
public async Task List_Works()
99
{
10-
var page = await this.client.Coupons.Subscriptions.List(new() { CouponID = "coupon_id" });
10+
var page = await this.client.Coupons.Subscriptions.List("coupon_id");
1111
page.Validate();
1212
}
1313
}

src/Orb.Tests/Services/CreditNoteServiceTest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ public async Task List_Works()
3838
[Fact]
3939
public async Task Fetch_Works()
4040
{
41-
var creditNote = await this.client.CreditNotes.Fetch(
42-
new() { CreditNoteID = "credit_note_id" }
43-
);
41+
var creditNote = await this.client.CreditNotes.Fetch("credit_note_id");
4442
creditNote.Validate();
4543
}
4644
}

src/Orb.Tests/Services/CustomerServiceTest.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public async Task Create_Works()
1616
[Fact]
1717
public async Task Update_Works()
1818
{
19-
var customer = await this.client.Customers.Update(new() { CustomerID = "customer_id" });
19+
var customer = await this.client.Customers.Update("customer_id");
2020
customer.Validate();
2121
}
2222

@@ -30,47 +30,41 @@ public async Task List_Works()
3030
[Fact]
3131
public async Task Delete_Works()
3232
{
33-
await this.client.Customers.Delete(new() { CustomerID = "customer_id" });
33+
await this.client.Customers.Delete("customer_id");
3434
}
3535

3636
[Fact]
3737
public async Task Fetch_Works()
3838
{
39-
var customer = await this.client.Customers.Fetch(new() { CustomerID = "customer_id" });
39+
var customer = await this.client.Customers.Fetch("customer_id");
4040
customer.Validate();
4141
}
4242

4343
[Fact]
4444
public async Task FetchByExternalID_Works()
4545
{
46-
var customer = await this.client.Customers.FetchByExternalID(
47-
new() { ExternalCustomerID = "external_customer_id" }
48-
);
46+
var customer = await this.client.Customers.FetchByExternalID("external_customer_id");
4947
customer.Validate();
5048
}
5149

5250
[Fact]
5351
public async Task SyncPaymentMethodsFromGateway_Works()
5452
{
55-
await this.client.Customers.SyncPaymentMethodsFromGateway(
56-
new() { CustomerID = "customer_id" }
57-
);
53+
await this.client.Customers.SyncPaymentMethodsFromGateway("customer_id");
5854
}
5955

6056
[Fact]
6157
public async Task SyncPaymentMethodsFromGatewayByExternalCustomerID_Works()
6258
{
6359
await this.client.Customers.SyncPaymentMethodsFromGatewayByExternalCustomerID(
64-
new() { ExternalCustomerID = "external_customer_id" }
60+
"external_customer_id"
6561
);
6662
}
6763

6864
[Fact]
6965
public async Task UpdateByExternalID_Works()
7066
{
71-
var customer = await this.client.Customers.UpdateByExternalID(
72-
new() { ID = "external_customer_id" }
73-
);
67+
var customer = await this.client.Customers.UpdateByExternalID("external_customer_id");
7468
customer.Validate();
7569
}
7670
}

src/Orb.Tests/Services/Customers/BalanceTransactionServiceTest.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ public class BalanceTransactionServiceTest : TestBase
99
public async Task Create_Works()
1010
{
1111
var balanceTransaction = await this.client.Customers.BalanceTransactions.Create(
12-
new()
13-
{
14-
CustomerID = "customer_id",
15-
Amount = "amount",
16-
Type = Type.Increment,
17-
}
12+
"customer_id",
13+
new() { Amount = "amount", Type = Type.Increment }
1814
);
1915
balanceTransaction.Validate();
2016
}
2117

2218
[Fact]
2319
public async Task List_Works()
2420
{
25-
var page = await this.client.Customers.BalanceTransactions.List(
26-
new() { CustomerID = "customer_id" }
27-
);
21+
var page = await this.client.Customers.BalanceTransactions.List("customer_id");
2822
page.Validate();
2923
}
3024
}

src/Orb.Tests/Services/Customers/CostServiceTest.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ public class CostServiceTest : TestBase
77
[Fact]
88
public async Task List_Works()
99
{
10-
var costs = await this.client.Customers.Costs.List(new() { CustomerID = "customer_id" });
10+
var costs = await this.client.Customers.Costs.List("customer_id");
1111
costs.Validate();
1212
}
1313

1414
[Fact]
1515
public async Task ListByExternalID_Works()
1616
{
17-
var response = await this.client.Customers.Costs.ListByExternalID(
18-
new() { ExternalCustomerID = "external_customer_id" }
19-
);
17+
var response = await this.client.Customers.Costs.ListByExternalID("external_customer_id");
2018
response.Validate();
2119
}
2220
}

src/Orb.Tests/Services/Customers/CreditServiceTest.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ public class CreditServiceTest : TestBase
77
[Fact]
88
public async Task List_Works()
99
{
10-
var page = await this.client.Customers.Credits.List(new() { CustomerID = "customer_id" });
10+
var page = await this.client.Customers.Credits.List("customer_id");
1111
page.Validate();
1212
}
1313

1414
[Fact]
1515
public async Task ListByExternalID_Works()
1616
{
17-
var page = await this.client.Customers.Credits.ListByExternalID(
18-
new() { ExternalCustomerID = "external_customer_id" }
19-
);
17+
var page = await this.client.Customers.Credits.ListByExternalID("external_customer_id");
2018
page.Validate();
2119
}
2220
}

0 commit comments

Comments
 (0)