Skip to content

Commit a369ef4

Browse files
feat(api): api update
1 parent b7feea0 commit a369ef4

File tree

10 files changed

+72
-82
lines changed

10 files changed

+72
-82
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d1abf71a1a70a43bdcc4da7104dabcbd67aa7e2d3e6cf21e33f50904b6997bb2.yml
3-
openapi_spec_hash: 28b0b31a997588cf3692458889321e1b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-d74790c0b5540235e8387ccad7b806c11bcbb968fbdf99ea7dfbfc004bceb9dc.yml
3+
openapi_spec_hash: eae212fa0114d8c3b4293c35f6ed7f7f
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

src/Orb.Tests/Services/Customers/Credits/Ledger/LedgerServiceTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ public async Task CreateEntry_Works()
4545
InvoiceSettings = new()
4646
{
4747
AutoCollection = true,
48-
NetTerms = 0,
4948
CustomDueDate = new(DateOnly.Parse("2019-12-27")),
5049
InvoiceDate = new(DateOnly.Parse("2019-12-27")),
5150
ItemID = "item_id",
5251
Memo = "memo",
52+
NetTerms = 0,
5353
RequireSuccessfulPayment = true,
5454
},
5555
Metadata = new Dictionary<string, string?>() { { "foo", "string" } },
@@ -88,11 +88,11 @@ public async Task CreateEntryByExternalID_Works()
8888
InvoiceSettings = new()
8989
{
9090
AutoCollection = true,
91-
NetTerms = 0,
9291
CustomDueDate = new(DateOnly.Parse("2019-12-27")),
9392
InvoiceDate = new(DateOnly.Parse("2019-12-27")),
9493
ItemID = "item_id",
9594
Memo = "memo",
95+
NetTerms = 0,
9696
RequireSuccessfulPayment = true,
9797
},
9898
Metadata = new Dictionary<string, string?>() { { "foo", "string" } },

src/Orb/Models/Beta/BetaFetchPlanVersionParams.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
namespace Orb.Models.Beta;
66

77
/// <summary>
8-
/// This API endpoint is in beta and its interface may change. It is recommended for
9-
/// use only in test mode.
10-
///
118
/// This endpoint is used to fetch a plan version. It returns the phases, prices,
129
/// and adjustments present on this version of the plan.
1310
/// </summary>

src/Orb/Models/Beta/BetaSetDefaultPlanVersionParams.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
namespace Orb.Models.Beta;
1010

1111
/// <summary>
12-
/// This API endpoint is in beta and its interface may change. It is recommended for
13-
/// use only in test mode.
14-
///
1512
/// This endpoint allows setting the default version of a plan.
1613
/// </summary>
1714
public sealed record class BetaSetDefaultPlanVersionParams : ParamsBase

src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDFetchPlanVersionParams.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
namespace Orb.Models.Beta.ExternalPlanID;
66

77
/// <summary>
8-
/// This API endpoint is in beta and its interface may change. It is recommended for
9-
/// use only in test mode.
10-
///
118
/// This endpoint is used to fetch a plan version. It returns the phases, prices,
129
/// and adjustments present on this version of the plan.
1310
/// </summary>

src/Orb/Models/Beta/ExternalPlanID/ExternalPlanIDSetDefaultPlanVersionParams.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
namespace Orb.Models.Beta.ExternalPlanID;
1010

1111
/// <summary>
12-
/// This API endpoint is in beta and its interface may change. It is recommended for
13-
/// use only in test mode.
14-
///
1512
/// This endpoint allows setting the default version of a plan.
1613
/// </summary>
1714
public sealed record class ExternalPlanIDSetDefaultPlanVersionParams : ParamsBase

src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryByExternalIDParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,6 @@ public required bool AutoCollection
4242
}
4343
}
4444

45-
/// <summary>
46-
/// The net terms determines the due date of the invoice. Due date is calculated
47-
/// based on the invoice or issuance date, depending on the account's configured
48-
/// due date calculation method. A value of '0' here represents that the invoice
49-
/// is due on issue, whereas a value of '30' represents that the customer has
50-
/// 30 days to pay the invoice. Do not set this field if you want to set a custom
51-
/// due date.
52-
/// </summary>
53-
public required long? NetTerms
54-
{
55-
get
56-
{
57-
if (!this.Properties.TryGetValue("net_terms", out JsonElement element))
58-
return null;
59-
60-
return JsonSerializer.Deserialize<long?>(element, ModelBase.SerializerOptions);
61-
}
62-
set
63-
{
64-
this.Properties["net_terms"] = JsonSerializer.SerializeToElement(
65-
value,
66-
ModelBase.SerializerOptions
67-
);
68-
}
69-
}
70-
7145
/// <summary>
7246
/// An optional custom due date for the invoice. If not set, the due date will
7347
/// be calculated based on the `net_terms` value.
@@ -156,6 +130,32 @@ public string? Memo
156130
}
157131
}
158132

133+
/// <summary>
134+
/// The net terms determines the due date of the invoice. Due date is calculated
135+
/// based on the invoice or issuance date, depending on the account's configured
136+
/// due date calculation method. A value of '0' here represents that the invoice
137+
/// is due on issue, whereas a value of '30' represents that the customer has
138+
/// 30 days to pay the invoice. Do not set this field if you want to set a custom
139+
/// due date.
140+
/// </summary>
141+
public long? NetTerms
142+
{
143+
get
144+
{
145+
if (!this.Properties.TryGetValue("net_terms", out JsonElement element))
146+
return null;
147+
148+
return JsonSerializer.Deserialize<long?>(element, ModelBase.SerializerOptions);
149+
}
150+
set
151+
{
152+
this.Properties["net_terms"] = JsonSerializer.SerializeToElement(
153+
value,
154+
ModelBase.SerializerOptions
155+
);
156+
}
157+
}
158+
159159
/// <summary>
160160
/// If true, the new credit block will require that the corresponding invoice
161161
/// is paid before it can be drawn down from.
@@ -181,11 +181,11 @@ public bool? RequireSuccessfulPayment
181181
public override void Validate()
182182
{
183183
_ = this.AutoCollection;
184-
_ = this.NetTerms;
185184
this.CustomDueDate?.Validate();
186185
this.InvoiceDate?.Validate();
187186
_ = this.ItemID;
188187
_ = this.Memo;
188+
_ = this.NetTerms;
189189
_ = this.RequireSuccessfulPayment;
190190
}
191191

@@ -203,4 +203,11 @@ public static InvoiceSettings FromRawUnchecked(Dictionary<string, JsonElement> p
203203
{
204204
return new(properties);
205205
}
206+
207+
[SetsRequiredMembers]
208+
public InvoiceSettings(bool autoCollection)
209+
: this()
210+
{
211+
this.AutoCollection = autoCollection;
212+
}
206213
}

src/Orb/Models/Customers/Credits/Ledger/LedgerCreateEntryParamsProperties/BodyProperties/IncrementProperties/InvoiceSettings.cs

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,6 @@ public required bool AutoCollection
4242
}
4343
}
4444

45-
/// <summary>
46-
/// The net terms determines the due date of the invoice. Due date is calculated
47-
/// based on the invoice or issuance date, depending on the account's configured
48-
/// due date calculation method. A value of '0' here represents that the invoice
49-
/// is due on issue, whereas a value of '30' represents that the customer has
50-
/// 30 days to pay the invoice. Do not set this field if you want to set a custom
51-
/// due date.
52-
/// </summary>
53-
public required long? NetTerms
54-
{
55-
get
56-
{
57-
if (!this.Properties.TryGetValue("net_terms", out JsonElement element))
58-
return null;
59-
60-
return JsonSerializer.Deserialize<long?>(element, ModelBase.SerializerOptions);
61-
}
62-
set
63-
{
64-
this.Properties["net_terms"] = JsonSerializer.SerializeToElement(
65-
value,
66-
ModelBase.SerializerOptions
67-
);
68-
}
69-
}
70-
7145
/// <summary>
7246
/// An optional custom due date for the invoice. If not set, the due date will
7347
/// be calculated based on the `net_terms` value.
@@ -156,6 +130,32 @@ public string? Memo
156130
}
157131
}
158132

133+
/// <summary>
134+
/// The net terms determines the due date of the invoice. Due date is calculated
135+
/// based on the invoice or issuance date, depending on the account's configured
136+
/// due date calculation method. A value of '0' here represents that the invoice
137+
/// is due on issue, whereas a value of '30' represents that the customer has
138+
/// 30 days to pay the invoice. Do not set this field if you want to set a custom
139+
/// due date.
140+
/// </summary>
141+
public long? NetTerms
142+
{
143+
get
144+
{
145+
if (!this.Properties.TryGetValue("net_terms", out JsonElement element))
146+
return null;
147+
148+
return JsonSerializer.Deserialize<long?>(element, ModelBase.SerializerOptions);
149+
}
150+
set
151+
{
152+
this.Properties["net_terms"] = JsonSerializer.SerializeToElement(
153+
value,
154+
ModelBase.SerializerOptions
155+
);
156+
}
157+
}
158+
159159
/// <summary>
160160
/// If true, the new credit block will require that the corresponding invoice
161161
/// is paid before it can be drawn down from.
@@ -181,11 +181,11 @@ public bool? RequireSuccessfulPayment
181181
public override void Validate()
182182
{
183183
_ = this.AutoCollection;
184-
_ = this.NetTerms;
185184
this.CustomDueDate?.Validate();
186185
this.InvoiceDate?.Validate();
187186
_ = this.ItemID;
188187
_ = this.Memo;
188+
_ = this.NetTerms;
189189
_ = this.RequireSuccessfulPayment;
190190
}
191191

@@ -203,4 +203,11 @@ public static InvoiceSettings FromRawUnchecked(Dictionary<string, JsonElement> p
203203
{
204204
return new(properties);
205205
}
206+
207+
[SetsRequiredMembers]
208+
public InvoiceSettings(bool autoCollection)
209+
: this()
210+
{
211+
this.AutoCollection = autoCollection;
212+
}
206213
}

src/Orb/Services/Beta/ExternalPlanID/IExternalPlanIDService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,12 @@ public interface IExternalPlanIDService
1313
Task<PlanVersion> CreatePlanVersion(ExternalPlanIDCreatePlanVersionParams parameters);
1414

1515
/// <summary>
16-
/// This API endpoint is in beta and its interface may change. It is recommended
17-
/// for use only in test mode.
18-
///
1916
/// This endpoint is used to fetch a plan version. It returns the phases, prices,
2017
/// and adjustments present on this version of the plan.
2118
/// </summary>
2219
Task<PlanVersion> FetchPlanVersion(ExternalPlanIDFetchPlanVersionParams parameters);
2320

2421
/// <summary>
25-
/// This API endpoint is in beta and its interface may change. It is recommended
26-
/// for use only in test mode.
27-
///
2822
/// This endpoint allows setting the default version of a plan.
2923
/// </summary>
3024
Task<Plan> SetDefaultPlanVersion(ExternalPlanIDSetDefaultPlanVersionParams parameters);

src/Orb/Services/Beta/IBetaService.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,12 @@ public interface IBetaService
1515
Task<PlanVersion> CreatePlanVersion(BetaCreatePlanVersionParams parameters);
1616

1717
/// <summary>
18-
/// This API endpoint is in beta and its interface may change. It is recommended
19-
/// for use only in test mode.
20-
///
2118
/// This endpoint is used to fetch a plan version. It returns the phases, prices,
2219
/// and adjustments present on this version of the plan.
2320
/// </summary>
2421
Task<PlanVersion> FetchPlanVersion(BetaFetchPlanVersionParams parameters);
2522

2623
/// <summary>
27-
/// This API endpoint is in beta and its interface may change. It is recommended
28-
/// for use only in test mode.
29-
///
3024
/// This endpoint allows setting the default version of a plan.
3125
/// </summary>
3226
Task<Plan> SetDefaultPlanVersion(BetaSetDefaultPlanVersionParams parameters);

0 commit comments

Comments
 (0)