Skip to content

Commit 1a56902

Browse files
feat(api): api update
1 parent 4934a71 commit 1a56902

File tree

4 files changed

+85
-7
lines changed

4 files changed

+85
-7
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-36e32afb76082ffbe12a71342ed5b855b9ae83d8c5bcd225fe23915c308b39e7.yml
3-
openapi_spec_hash: 035e0bb6141d78b4aed031303585940c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0ab0946487d1ee971683d894554494d9940010403874c0be724ffc3a82d696db.yml
3+
openapi_spec_hash: 66b792328a4faee3c7659185accc3f0e
44
config_hash: e6db17547fe854b1c240407cf4c6dc9e

src/Orb.Tests/Services/PlanServiceTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public async Task Create_Works()
3838
Values = ["string"],
3939
},
4040
],
41+
ItemID = "item_id",
42+
PerUnitCostBasis = "per_unit_cost_basis",
4143
},
4244
PlanPhaseOrder = 0,
4345
Price1 = new NewPlanUnitPrice()

src/Orb/Models/NewAllocationPrice.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,57 @@ public List<Filter11>? Filters
166166
}
167167
}
168168

169+
/// <summary>
170+
/// The item ID that line items representing charges for this allocation will
171+
/// be associated with. If not provided, the default allocation item for the
172+
/// currency will be used (e.g. 'Included Allocation (USD)').
173+
/// </summary>
174+
public string? ItemID
175+
{
176+
get
177+
{
178+
if (!this._rawData.TryGetValue("item_id", out JsonElement element))
179+
return null;
180+
181+
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
182+
}
183+
init
184+
{
185+
this._rawData["item_id"] = JsonSerializer.SerializeToElement(
186+
value,
187+
ModelBase.SerializerOptions
188+
);
189+
}
190+
}
191+
192+
/// <summary>
193+
/// The (per-unit) cost basis of each created block. If non-zero, a customer
194+
/// will be invoiced according to the quantity and per unit cost basis specified
195+
/// for the allocation each cadence.
196+
/// </summary>
197+
public string? PerUnitCostBasis
198+
{
199+
get
200+
{
201+
if (!this._rawData.TryGetValue("per_unit_cost_basis", out JsonElement element))
202+
return null;
203+
204+
return JsonSerializer.Deserialize<string?>(element, ModelBase.SerializerOptions);
205+
}
206+
init
207+
{
208+
if (value == null)
209+
{
210+
return;
211+
}
212+
213+
this._rawData["per_unit_cost_basis"] = JsonSerializer.SerializeToElement(
214+
value,
215+
ModelBase.SerializerOptions
216+
);
217+
}
218+
}
219+
169220
public override void Validate()
170221
{
171222
_ = this.Amount;
@@ -177,6 +228,8 @@ public override void Validate()
177228
{
178229
item.Validate();
179230
}
231+
_ = this.ItemID;
232+
_ = this.PerUnitCostBasis;
180233
}
181234

182235
public NewAllocationPrice() { }

src/Orb/Models/Subscriptions/SubscriptionPriceIntervalsParams.cs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,8 @@ out JsonElement element
174174
}
175175

176176
/// <summary>
177-
/// If true, ending an in-arrears price interval mid-cycle will defer billing
178-
/// the final line itemuntil the next scheduled invoice. If false, it will be
179-
/// billed on its end date. If not provided, behaviorwill follow account default.
177+
/// If set, the default value to use for added/edited price intervals with an
178+
/// end_date set.
180179
/// </summary>
181180
public bool? CanDeferBilling
182181
{
@@ -376,6 +375,29 @@ public NewAllocationPrice? AllocationPrice
376375
}
377376
}
378377

378+
/// <summary>
379+
/// If true, an in-arrears price interval ending mid-cycle will defer billing
380+
/// the final line item until the next scheduled invoice. If false, it will be
381+
/// billed on its end date.
382+
/// </summary>
383+
public bool? CanDeferBilling
384+
{
385+
get
386+
{
387+
if (!this._rawData.TryGetValue("can_defer_billing", out JsonElement element))
388+
return null;
389+
390+
return JsonSerializer.Deserialize<bool?>(element, ModelBase.SerializerOptions);
391+
}
392+
init
393+
{
394+
this._rawData["can_defer_billing"] = JsonSerializer.SerializeToElement(
395+
value,
396+
ModelBase.SerializerOptions
397+
);
398+
}
399+
}
400+
379401
/// <summary>
380402
/// A list of discounts to initialize on the price interval.
381403
/// </summary>
@@ -611,6 +633,7 @@ public override void Validate()
611633
{
612634
this.StartDate.Validate();
613635
this.AllocationPrice?.Validate();
636+
_ = this.CanDeferBilling;
614637
foreach (var item in this.Discounts ?? [])
615638
{
616639
item.Validate();
@@ -9374,9 +9397,9 @@ public long? BillingCycleDay
93749397
}
93759398

93769399
/// <summary>
9377-
/// If true, ending an in-arrears price interval mid-cycle will defer billing
9400+
/// If true, an in-arrears price interval ending mid-cycle will defer billing
93789401
/// the final line item until the next scheduled invoice. If false, it will be
9379-
/// billed on its end date. If not provided, behavior will follow account default.
9402+
/// billed on its end date.
93809403
/// </summary>
93819404
public bool? CanDeferBilling
93829405
{

0 commit comments

Comments
 (0)