Skip to content

Commit fa02766

Browse files
fix(client): freeze models on property access
1 parent b33a931 commit fa02766

File tree

330 files changed

+24095
-4405
lines changed

Some content is hidden

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

330 files changed

+24095
-4405
lines changed

src/Orb/Models/Address.cs

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,61 @@ public sealed record class Address : JsonModel
1212
{
1313
public required string? City
1414
{
15-
get { return this._rawData.GetNullableClass<string>("city"); }
15+
get
16+
{
17+
this._rawData.Freeze();
18+
return this._rawData.GetNullableClass<string>("city");
19+
}
1620
init { this._rawData.Set("city", value); }
1721
}
1822

1923
public required string? Country
2024
{
21-
get { return this._rawData.GetNullableClass<string>("country"); }
25+
get
26+
{
27+
this._rawData.Freeze();
28+
return this._rawData.GetNullableClass<string>("country");
29+
}
2230
init { this._rawData.Set("country", value); }
2331
}
2432

2533
public required string? Line1
2634
{
27-
get { return this._rawData.GetNullableClass<string>("line1"); }
35+
get
36+
{
37+
this._rawData.Freeze();
38+
return this._rawData.GetNullableClass<string>("line1");
39+
}
2840
init { this._rawData.Set("line1", value); }
2941
}
3042

3143
public required string? Line2
3244
{
33-
get { return this._rawData.GetNullableClass<string>("line2"); }
45+
get
46+
{
47+
this._rawData.Freeze();
48+
return this._rawData.GetNullableClass<string>("line2");
49+
}
3450
init { this._rawData.Set("line2", value); }
3551
}
3652

3753
public required string? PostalCode
3854
{
39-
get { return this._rawData.GetNullableClass<string>("postal_code"); }
55+
get
56+
{
57+
this._rawData.Freeze();
58+
return this._rawData.GetNullableClass<string>("postal_code");
59+
}
4060
init { this._rawData.Set("postal_code", value); }
4161
}
4262

4363
public required string? State
4464
{
45-
get { return this._rawData.GetNullableClass<string>("state"); }
65+
get
66+
{
67+
this._rawData.Freeze();
68+
return this._rawData.GetNullableClass<string>("state");
69+
}
4670
init { this._rawData.Set("state", value); }
4771
}
4872

src/Orb/Models/AdjustmentInterval.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,21 @@ public sealed record class AdjustmentInterval : JsonModel
1515
{
1616
public required string ID
1717
{
18-
get { return this._rawData.GetNotNullClass<string>("id"); }
18+
get
19+
{
20+
this._rawData.Freeze();
21+
return this._rawData.GetNotNullClass<string>("id");
22+
}
1923
init { this._rawData.Set("id", value); }
2024
}
2125

2226
public required Adjustment Adjustment
2327
{
24-
get { return this._rawData.GetNotNullClass<Adjustment>("adjustment"); }
28+
get
29+
{
30+
this._rawData.Freeze();
31+
return this._rawData.GetNotNullClass<Adjustment>("adjustment");
32+
}
2533
init { this._rawData.Set("adjustment", value); }
2634
}
2735

@@ -32,6 +40,7 @@ public required IReadOnlyList<string> AppliesToPriceIntervalIds
3240
{
3341
get
3442
{
43+
this._rawData.Freeze();
3544
return this._rawData.GetNotNullStruct<ImmutableArray<string>>(
3645
"applies_to_price_interval_ids"
3746
);
@@ -50,7 +59,11 @@ public required IReadOnlyList<string> AppliesToPriceIntervalIds
5059
/// </summary>
5160
public required System::DateTimeOffset? EndDate
5261
{
53-
get { return this._rawData.GetNullableStruct<System::DateTimeOffset>("end_date"); }
62+
get
63+
{
64+
this._rawData.Freeze();
65+
return this._rawData.GetNullableStruct<System::DateTimeOffset>("end_date");
66+
}
5467
init { this._rawData.Set("end_date", value); }
5568
}
5669

@@ -59,7 +72,11 @@ public required IReadOnlyList<string> AppliesToPriceIntervalIds
5972
/// </summary>
6073
public required System::DateTimeOffset StartDate
6174
{
62-
get { return this._rawData.GetNotNullStruct<System::DateTimeOffset>("start_date"); }
75+
get
76+
{
77+
this._rawData.Freeze();
78+
return this._rawData.GetNotNullStruct<System::DateTimeOffset>("start_date");
79+
}
6380
init { this._rawData.Set("start_date", value); }
6481
}
6582

src/Orb/Models/AggregatedCost.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public required IReadOnlyList<PerPriceCost> PerPriceCosts
1616
{
1717
get
1818
{
19+
this._rawData.Freeze();
1920
return this._rawData.GetNotNullStruct<ImmutableArray<PerPriceCost>>("per_price_costs");
2021
}
2122
init
@@ -32,19 +33,31 @@ public required IReadOnlyList<PerPriceCost> PerPriceCosts
3233
/// </summary>
3334
public required string Subtotal
3435
{
35-
get { return this._rawData.GetNotNullClass<string>("subtotal"); }
36+
get
37+
{
38+
this._rawData.Freeze();
39+
return this._rawData.GetNotNullClass<string>("subtotal");
40+
}
3641
init { this._rawData.Set("subtotal", value); }
3742
}
3843

3944
public required DateTimeOffset TimeframeEnd
4045
{
41-
get { return this._rawData.GetNotNullStruct<DateTimeOffset>("timeframe_end"); }
46+
get
47+
{
48+
this._rawData.Freeze();
49+
return this._rawData.GetNotNullStruct<DateTimeOffset>("timeframe_end");
50+
}
4251
init { this._rawData.Set("timeframe_end", value); }
4352
}
4453

4554
public required DateTimeOffset TimeframeStart
4655
{
47-
get { return this._rawData.GetNotNullStruct<DateTimeOffset>("timeframe_start"); }
56+
get
57+
{
58+
this._rawData.Freeze();
59+
return this._rawData.GetNotNullStruct<DateTimeOffset>("timeframe_start");
60+
}
4861
init { this._rawData.Set("timeframe_start", value); }
4962
}
5063

@@ -53,7 +66,11 @@ public required DateTimeOffset TimeframeStart
5366
/// </summary>
5467
public required string Total
5568
{
56-
get { return this._rawData.GetNotNullClass<string>("total"); }
69+
get
70+
{
71+
this._rawData.Freeze();
72+
return this._rawData.GetNotNullClass<string>("total");
73+
}
5774
init { this._rawData.Set("total", value); }
5875
}
5976

0 commit comments

Comments
 (0)