Skip to content

Commit a552c2c

Browse files
committed
Fix Firecrawl OpenAPI update generation
1 parent dc90c54 commit a552c2c

226 files changed

Lines changed: 943 additions & 688 deletions

File tree

Some content is hidden

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

src/libs/Firecrawl/Generated/Firecrawl.AllOf.2.g.cs

Lines changed: 80 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
namespace Firecrawl
55
{
66
/// <summary>
7-
///
7+
///
88
/// </summary>
99
public readonly partial struct AllOf<T1, T2> : global::System.IEquatable<AllOf<T1, T2>>
1010
{
1111
/// <summary>
12-
///
12+
///
1313
/// </summary>
1414
#if NET6_0_OR_GREATER
1515
public T1? Value1 { get; init; }
@@ -18,15 +18,28 @@ namespace Firecrawl
1818
#endif
1919

2020
/// <summary>
21-
///
21+
///
2222
/// </summary>
2323
#if NET6_0_OR_GREATER
2424
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))]
2525
#endif
2626
public bool IsValue1 => Value1 != null;
2727

2828
/// <summary>
29-
///
29+
///
30+
/// </summary>
31+
public bool TryPickValue1(
32+
#if NET6_0_OR_GREATER
33+
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
34+
#endif
35+
out T1? value)
36+
{
37+
value = Value1;
38+
return IsValue1;
39+
}
40+
41+
/// <summary>
42+
///
3043
/// </summary>
3144
#if NET6_0_OR_GREATER
3245
public T2? Value2 { get; init; }
@@ -35,50 +48,63 @@ namespace Firecrawl
3548
#endif
3649

3750
/// <summary>
38-
///
51+
///
3952
/// </summary>
4053
#if NET6_0_OR_GREATER
4154
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))]
4255
#endif
4356
public bool IsValue2 => Value2 != null;
57+
58+
/// <summary>
59+
///
60+
/// </summary>
61+
public bool TryPickValue2(
62+
#if NET6_0_OR_GREATER
63+
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
64+
#endif
65+
out T2? value)
66+
{
67+
value = Value2;
68+
return IsValue2;
69+
}
4470
/// <summary>
45-
///
71+
///
4672
/// </summary>
4773
public static implicit operator AllOf<T1, T2>(T1 value) => new AllOf<T1, T2>((T1?)value);
4874

4975
/// <summary>
50-
///
76+
///
5177
/// </summary>
5278
public static implicit operator T1?(AllOf<T1, T2> @this) => @this.Value1;
5379

5480
/// <summary>
55-
///
81+
///
5682
/// </summary>
5783
public AllOf(T1? value)
5884
{
5985
Value1 = value;
6086
}
6187

6288
/// <summary>
63-
///
89+
///
6490
/// </summary>
6591
public static implicit operator AllOf<T1, T2>(T2 value) => new AllOf<T1, T2>((T2?)value);
6692

6793
/// <summary>
68-
///
94+
///
6995
/// </summary>
7096
public static implicit operator T2?(AllOf<T1, T2> @this) => @this.Value2;
7197

7298
/// <summary>
73-
///
99+
///
74100
/// </summary>
75101
public AllOf(T2? value)
76102
{
77103
Value2 = value;
78104
}
79105

80106
/// <summary>
81-
///
107+
///
82108
/// </summary>
83109
public AllOf(
84110
T1? value1,
@@ -90,56 +116,45 @@ public AllOf(
90116
}
91117

92118
/// <summary>
93-
///
119+
///
94120
/// </summary>
95121
public object? Object =>
96122
Value2 as object ??
97-
Value1 as object
123+
Value1 as object
98124
;
99125

100126
/// <summary>
101-
///
127+
///
102128
/// </summary>
103129
public override string? ToString() =>
104130
Value1?.ToString() ??
105-
Value2?.ToString()
131+
Value2?.ToString()
106132
;
107133

108-
private static bool RequiresValue<TValue>() => RequirementCache<TValue>.Value;
109-
110-
private static bool DetermineRequiresValue(global::System.Type type)
134+
private static bool RequiresValue<TValue>()
111135
{
136+
var type = typeof(TValue);
112137
if (global::System.Nullable.GetUnderlyingType(type) != null)
113138
{
114139
return false;
115140
}
116141

117-
if (type.IsValueType ||
118-
type == typeof(string) ||
119-
type.IsArray)
120-
{
121-
return true;
122-
}
123-
124-
return false;
125-
}
126-
127-
private static class RequirementCache<TValue>
128-
{
129-
public static readonly bool Value = DetermineRequiresValue(typeof(TValue));
142+
return type.IsValueType ||
143+
type == typeof(string) ||
144+
type.IsArray;
130145
}
131146

132147

133148
/// <summary>
134-
///
149+
///
135150
/// </summary>
136151
public bool Validate()
137152
{
138153
return (!RequiresValue<T1>() || IsValue1) && (!RequiresValue<T2>() || IsValue2);
139154
}
140155

141156
/// <summary>
142-
///
157+
///
143158
/// </summary>
144159
public TResult? Match<TResult>(
145160
global::System.Func<T1, TResult>? value1 = null,
@@ -164,10 +179,34 @@ public bool Validate()
164179
}
165180

166181
/// <summary>
167-
///
182+
///
168183
/// </summary>
169184
public void Match(
170185
global::System.Action<T1>? value1 = null,
186+
187+
global::System.Action<T2>? value2 = null,
188+
bool validate = true)
189+
{
190+
if (validate)
191+
{
192+
Validate();
193+
}
194+
195+
if (IsValue1)
196+
{
197+
value1?.Invoke(Value1!);
198+
}
199+
else if (IsValue2)
200+
{
201+
value2?.Invoke(Value2!);
202+
}
203+
}
204+
205+
/// <summary>
206+
///
207+
/// </summary>
208+
public void Switch(
209+
global::System.Action<T1>? value1 = null,
171210
global::System.Action<T2>? value2 = null,
172211
bool validate = true)
173212
{
@@ -187,7 +226,7 @@ public void Match(
187226
}
188227

189228
/// <summary>
190-
///
229+
///
191230
/// </summary>
192231
public override int GetHashCode()
193232
{
@@ -208,34 +247,34 @@ static int HashCodeAggregator(int hashCode, object? value) => value == null
208247
}
209248

210249
/// <summary>
211-
///
250+
///
212251
/// </summary>
213252
public bool Equals(AllOf<T1, T2> other)
214253
{
215254
return
216255
global::System.Collections.Generic.EqualityComparer<T1?>.Default.Equals(Value1, other.Value1) &&
217-
global::System.Collections.Generic.EqualityComparer<T2?>.Default.Equals(Value2, other.Value2)
256+
global::System.Collections.Generic.EqualityComparer<T2?>.Default.Equals(Value2, other.Value2)
218257
;
219258
}
220259

221260
/// <summary>
222-
///
261+
///
223262
/// </summary>
224263
public static bool operator ==(AllOf<T1, T2> obj1, AllOf<T1, T2> obj2)
225264
{
226265
return global::System.Collections.Generic.EqualityComparer<AllOf<T1, T2>>.Default.Equals(obj1, obj2);
227266
}
228267

229268
/// <summary>
230-
///
269+
///
231270
/// </summary>
232271
public static bool operator !=(AllOf<T1, T2> obj1, AllOf<T1, T2> obj2)
233272
{
234273
return !(obj1 == obj2);
235274
}
236275

237276
/// <summary>
238-
///
277+
///
239278
/// </summary>
240279
public override bool Equals(object? obj)
241280
{

src/libs/Firecrawl/Generated/Firecrawl.BillingClient.GetCreditUsage.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ partial void ProcessGetCreditUsageResponseContent(
124124
__authorization.Location == "Header")
125125
{
126126
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
127-
}
127+
}
128128
}
129129
global::Firecrawl.AutoSDKRequestOptionsSupport.ApplyHeaders(
130130
request: __httpRequest,

src/libs/Firecrawl/Generated/Firecrawl.BillingClient.GetTokenUsage.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ partial void ProcessGetTokenUsageResponseContent(
124124
__authorization.Location == "Header")
125125
{
126126
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
127-
}
127+
}
128128
}
129129
global::Firecrawl.AutoSDKRequestOptionsSupport.ApplyHeaders(
130130
request: __httpRequest,

src/libs/Firecrawl/Generated/Firecrawl.BillingClient.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Firecrawl
1010
public sealed partial class BillingClient : global::Firecrawl.IBillingClient, global::System.IDisposable
1111
{
1212
/// <summary>
13-
///
13+
///
1414
/// </summary>
1515
public const string DefaultBaseUrl = "https://api.firecrawl.dev/v1";
1616

@@ -34,7 +34,7 @@ public sealed partial class BillingClient : global::Firecrawl.IBillingClient, gl
3434
/// <inheritdoc/>
3535
public global::Firecrawl.AutoSDKClientOptions Options { get; }
3636
/// <summary>
37-
///
37+
///
3838
/// </summary>
3939
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Firecrawl.SourceGenerationContext.Default;
4040

src/libs/Firecrawl/Generated/Firecrawl.CrawlingClient.CancelCrawl.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ partial void ProcessCancelCrawlResponseContent(
132132
__authorization.Location == "Header")
133133
{
134134
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
135-
}
135+
}
136136
}
137137
global::Firecrawl.AutoSDKRequestOptionsSupport.ApplyHeaders(
138138
request: __httpRequest,

src/libs/Firecrawl/Generated/Firecrawl.CrawlingClient.CrawlUrls.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ partial void ProcessCrawlUrlsResponseContent(
137137
__authorization.Location == "Header")
138138
{
139139
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
140-
}
140+
}
141141
}
142142
var __httpRequestContentBody = request.ToJson(JsonSerializerContext);
143143
var __httpRequestContent = new global::System.Net.Http.StringContent(

src/libs/Firecrawl/Generated/Firecrawl.CrawlingClient.GetActiveCrawls.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ partial void ProcessGetActiveCrawlsResponseContent(
124124
__authorization.Location == "Header")
125125
{
126126
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
127-
}
127+
}
128128
}
129129
global::Firecrawl.AutoSDKRequestOptionsSupport.ApplyHeaders(
130130
request: __httpRequest,

src/libs/Firecrawl/Generated/Firecrawl.CrawlingClient.GetCrawlErrors.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ partial void ProcessGetCrawlErrorsResponseContent(
132132
__authorization.Location == "Header")
133133
{
134134
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
135-
}
135+
}
136136
}
137137
global::Firecrawl.AutoSDKRequestOptionsSupport.ApplyHeaders(
138138
request: __httpRequest,

src/libs/Firecrawl/Generated/Firecrawl.CrawlingClient.GetCrawlStatus.g.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ partial void ProcessGetCrawlStatusResponseContent(
132132
__authorization.Location == "Header")
133133
{
134134
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
135-
}
135+
}
136136
}
137137
global::Firecrawl.AutoSDKRequestOptionsSupport.ApplyHeaders(
138138
request: __httpRequest,

src/libs/Firecrawl/Generated/Firecrawl.CrawlingClient.g.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Firecrawl
1010
public sealed partial class CrawlingClient : global::Firecrawl.ICrawlingClient, global::System.IDisposable
1111
{
1212
/// <summary>
13-
///
13+
///
1414
/// </summary>
1515
public const string DefaultBaseUrl = "https://api.firecrawl.dev/v1";
1616

@@ -34,7 +34,7 @@ public sealed partial class CrawlingClient : global::Firecrawl.ICrawlingClient,
3434
/// <inheritdoc/>
3535
public global::Firecrawl.AutoSDKClientOptions Options { get; }
3636
/// <summary>
37-
///
37+
///
3838
/// </summary>
3939
public global::System.Text.Json.Serialization.JsonSerializerContext JsonSerializerContext { get; set; } = global::Firecrawl.SourceGenerationContext.Default;
4040

0 commit comments

Comments
 (0)