From 49df43fdee6ab792ec4dbb8e5ebbfef4d749c9fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 May 2026 03:47:49 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...gents.CursorAgentsClient.ArchiveAgent.g.cs | 99 ++++++------- ...orAgents.CursorAgentsClient.CancelRun.g.cs | 114 +++++++-------- ...Agents.CursorAgentsClient.CreateAgent.g.cs | 114 +++++++-------- ...orAgents.CursorAgentsClient.CreateRun.g.cs | 129 ++++++++--------- ...nts.CursorAgentsClient.CreateSubToken.g.cs | 114 +++++++-------- ...Agents.CursorAgentsClient.DeleteAgent.g.cs | 99 ++++++------- ...s.CursorAgentsClient.DownloadArtifact.g.cs | 114 +++++++-------- ...sorAgents.CursorAgentsClient.GetAgent.g.cs | 99 ++++++------- ...ents.CursorAgentsClient.GetApiKeyInfo.g.cs | 69 ++++----- ...ursorAgents.CursorAgentsClient.GetRun.g.cs | 99 ++++++------- ...rAgents.CursorAgentsClient.ListAgents.g.cs | 99 ++++++------- ...ents.CursorAgentsClient.ListArtifacts.g.cs | 99 ++++++------- ...rAgents.CursorAgentsClient.ListModels.g.cs | 69 ++++----- ...s.CursorAgentsClient.ListRepositories.g.cs | 69 ++++----- ...sorAgents.CursorAgentsClient.ListRuns.g.cs | 99 ++++++------- ...orAgents.CursorAgentsClient.StreamRun.g.cs | 25 ++-- ...nts.CursorAgentsClient.UnarchiveAgent.g.cs | 99 ++++++------- .../Generated/CursorAgents.Exceptions.g.cs | 134 ++++++++++++++++++ 18 files changed, 865 insertions(+), 878 deletions(-) diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs index 3601380..1cb8a44 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ArchiveAgent.g.cs @@ -355,18 +355,17 @@ partial void ProcessArchiveAgentResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -393,18 +392,17 @@ partial void ProcessArchiveAgentResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -431,18 +429,17 @@ partial void ProcessArchiveAgentResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -469,18 +466,17 @@ partial void ProcessArchiveAgentResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -507,18 +503,17 @@ partial void ProcessArchiveAgentResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -552,17 +547,15 @@ partial void ProcessArchiveAgentResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -599,17 +592,15 @@ partial void ProcessArchiveAgentResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs index 1dea051..63022d2 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CancelRun.g.cs @@ -376,18 +376,17 @@ partial void ProcessCancelRunResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -414,18 +413,17 @@ partial void ProcessCancelRunResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -452,18 +450,17 @@ partial void ProcessCancelRunResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, or `run_not_cancellable`). if ((int)__response.StatusCode == 409) @@ -490,18 +487,17 @@ partial void ProcessCancelRunResponseContent( __exception_409 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -528,18 +524,17 @@ partial void ProcessCancelRunResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -566,18 +561,17 @@ partial void ProcessCancelRunResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -611,17 +605,15 @@ partial void ProcessCancelRunResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -658,17 +650,15 @@ partial void ProcessCancelRunResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs index 5b2e13e..22f6fbc 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateAgent.g.cs @@ -366,18 +366,17 @@ partial void ProcessCreateAgentResponseContent( __exception_400 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Invalid or missing API key. if ((int)__response.StatusCode == 401) @@ -404,18 +403,17 @@ partial void ProcessCreateAgentResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -442,18 +440,17 @@ partial void ProcessCreateAgentResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, or `run_not_cancellable`). if ((int)__response.StatusCode == 409) @@ -480,18 +477,17 @@ partial void ProcessCreateAgentResponseContent( __exception_409 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -518,18 +514,17 @@ partial void ProcessCreateAgentResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -556,18 +551,17 @@ partial void ProcessCreateAgentResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -601,17 +595,15 @@ partial void ProcessCreateAgentResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -648,17 +640,15 @@ partial void ProcessCreateAgentResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs index 3ebc8ee..546f50d 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateRun.g.cs @@ -379,18 +379,17 @@ partial void ProcessCreateRunResponseContent( __exception_400 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Invalid or missing API key. if ((int)__response.StatusCode == 401) @@ -417,18 +416,17 @@ partial void ProcessCreateRunResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -455,18 +453,17 @@ partial void ProcessCreateRunResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -493,18 +490,17 @@ partial void ProcessCreateRunResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Resource state conflict (`agent_busy`, `agent_archived`, `agent_id_conflict`, or `run_not_cancellable`). if ((int)__response.StatusCode == 409) @@ -531,18 +527,17 @@ partial void ProcessCreateRunResponseContent( __exception_409 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_409, - statusCode: __response.StatusCode) - { - ResponseBody = __content_409, - ResponseObject = __value_409, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -569,18 +564,17 @@ partial void ProcessCreateRunResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -607,18 +601,17 @@ partial void ProcessCreateRunResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -652,17 +645,15 @@ partial void ProcessCreateRunResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -699,17 +690,15 @@ partial void ProcessCreateRunResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateSubToken.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateSubToken.g.cs index ad28cc3..9b410ea 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateSubToken.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.CreateSubToken.g.cs @@ -366,18 +366,17 @@ partial void ProcessCreateSubTokenResponseContent( __exception_400 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Invalid or missing API key. if ((int)__response.StatusCode == 401) @@ -404,18 +403,17 @@ partial void ProcessCreateSubTokenResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -442,18 +440,17 @@ partial void ProcessCreateSubTokenResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -480,18 +477,17 @@ partial void ProcessCreateSubTokenResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -518,18 +514,17 @@ partial void ProcessCreateSubTokenResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -556,18 +551,17 @@ partial void ProcessCreateSubTokenResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -601,17 +595,15 @@ partial void ProcessCreateSubTokenResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -648,17 +640,15 @@ partial void ProcessCreateSubTokenResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs index b6a288e..8ee7e3c 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DeleteAgent.g.cs @@ -355,18 +355,17 @@ partial void ProcessDeleteAgentResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -393,18 +392,17 @@ partial void ProcessDeleteAgentResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -431,18 +429,17 @@ partial void ProcessDeleteAgentResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -469,18 +466,17 @@ partial void ProcessDeleteAgentResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -507,18 +503,17 @@ partial void ProcessDeleteAgentResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -552,17 +547,15 @@ partial void ProcessDeleteAgentResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -599,17 +592,15 @@ partial void ProcessDeleteAgentResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs index 92fe496..7f8dbbe 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.DownloadArtifact.g.cs @@ -375,18 +375,17 @@ partial void ProcessDownloadArtifactResponseContent( __exception_400 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Invalid or missing API key. if ((int)__response.StatusCode == 401) @@ -413,18 +412,17 @@ partial void ProcessDownloadArtifactResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -451,18 +449,17 @@ partial void ProcessDownloadArtifactResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -489,18 +486,17 @@ partial void ProcessDownloadArtifactResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -527,18 +523,17 @@ partial void ProcessDownloadArtifactResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -565,18 +560,17 @@ partial void ProcessDownloadArtifactResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -610,17 +604,15 @@ partial void ProcessDownloadArtifactResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -657,17 +649,15 @@ partial void ProcessDownloadArtifactResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs index 00e965c..0c880e7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetAgent.g.cs @@ -355,18 +355,17 @@ partial void ProcessGetAgentResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -393,18 +392,17 @@ partial void ProcessGetAgentResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -431,18 +429,17 @@ partial void ProcessGetAgentResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -469,18 +466,17 @@ partial void ProcessGetAgentResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -507,18 +503,17 @@ partial void ProcessGetAgentResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -552,17 +547,15 @@ partial void ProcessGetAgentResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -599,17 +592,15 @@ partial void ProcessGetAgentResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs index 97a33b8..e0d4481 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetApiKeyInfo.g.cs @@ -342,18 +342,17 @@ partial void ProcessGetApiKeyInfoResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -380,18 +379,17 @@ partial void ProcessGetApiKeyInfoResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -418,18 +416,17 @@ partial void ProcessGetApiKeyInfoResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -463,17 +460,15 @@ partial void ProcessGetApiKeyInfoResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -510,17 +505,15 @@ partial void ProcessGetApiKeyInfoResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs index e92aea7..c1743f7 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.GetRun.g.cs @@ -368,18 +368,17 @@ partial void ProcessGetRunResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -406,18 +405,17 @@ partial void ProcessGetRunResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -444,18 +442,17 @@ partial void ProcessGetRunResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -482,18 +479,17 @@ partial void ProcessGetRunResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -520,18 +516,17 @@ partial void ProcessGetRunResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -565,17 +560,15 @@ partial void ProcessGetRunResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -612,17 +605,15 @@ partial void ProcessGetRunResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs index 10dfa0c..f1f6c73 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListAgents.g.cs @@ -392,18 +392,17 @@ partial void ProcessListAgentsResponseContent( __exception_400 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_400, - statusCode: __response.StatusCode) - { - ResponseBody = __content_400, - ResponseObject = __value_400, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Invalid or missing API key. if ((int)__response.StatusCode == 401) @@ -430,18 +429,17 @@ partial void ProcessListAgentsResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -468,18 +466,17 @@ partial void ProcessListAgentsResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -506,18 +503,17 @@ partial void ProcessListAgentsResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -544,18 +540,17 @@ partial void ProcessListAgentsResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -589,17 +584,15 @@ partial void ProcessListAgentsResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -636,17 +629,15 @@ partial void ProcessListAgentsResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs index 0cb96e5..cd38f80 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListArtifacts.g.cs @@ -361,18 +361,17 @@ partial void ProcessListArtifactsResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -399,18 +398,17 @@ partial void ProcessListArtifactsResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -437,18 +435,17 @@ partial void ProcessListArtifactsResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -475,18 +472,17 @@ partial void ProcessListArtifactsResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -513,18 +509,17 @@ partial void ProcessListArtifactsResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -558,17 +553,15 @@ partial void ProcessListArtifactsResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -605,17 +598,15 @@ partial void ProcessListArtifactsResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs index b94115a..608ea45 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListModels.g.cs @@ -348,18 +348,17 @@ partial void ProcessListModelsResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -386,18 +385,17 @@ partial void ProcessListModelsResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -424,18 +422,17 @@ partial void ProcessListModelsResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -469,17 +466,15 @@ partial void ProcessListModelsResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -516,17 +511,15 @@ partial void ProcessListModelsResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs index 2a0a6e5..79a5eb5 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRepositories.g.cs @@ -354,18 +354,17 @@ partial void ProcessListRepositoriesResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -392,18 +391,17 @@ partial void ProcessListRepositoriesResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -430,18 +428,17 @@ partial void ProcessListRepositoriesResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -475,17 +472,15 @@ partial void ProcessListRepositoriesResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -522,17 +517,15 @@ partial void ProcessListRepositoriesResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs index ebbd301..4cf3d7d 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.ListRuns.g.cs @@ -381,18 +381,17 @@ partial void ProcessListRunsResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -419,18 +418,17 @@ partial void ProcessListRunsResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -457,18 +455,17 @@ partial void ProcessListRunsResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -495,18 +492,17 @@ partial void ProcessListRunsResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -533,18 +529,17 @@ partial void ProcessListRunsResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -578,17 +573,15 @@ partial void ProcessListRunsResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -625,17 +618,15 @@ partial void ProcessListRunsResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs index 76f0b8b..66467f5 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.StreamRun.g.cs @@ -362,17 +362,15 @@ partial void ProcessStreamRunResponse( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } using var __stream = await __response.Content.ReadAsStreamAsync( @@ -391,16 +389,15 @@ partial void ProcessStreamRunResponse( } var __streamedResponse = (string?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(string), JsonSerializerContext) ?? - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: $"Response deserialization failed for \"{__content}\" ", - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + innerException: null, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); yield return __streamedResponse; } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs index 0adb56a..dbdf986 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.CursorAgentsClient.UnarchiveAgent.g.cs @@ -355,18 +355,17 @@ partial void ProcessUnarchiveAgentResponseContent( __exception_401 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_401, - statusCode: __response.StatusCode) - { - ResponseBody = __content_401, - ResponseObject = __value_401, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Authenticated but insufficient permissions, plan required, or feature unavailable. if ((int)__response.StatusCode == 403) @@ -393,18 +392,17 @@ partial void ProcessUnarchiveAgentResponseContent( __exception_403 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_403, - statusCode: __response.StatusCode) - { - ResponseBody = __content_403, - ResponseObject = __value_403, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Agent or run not found. if ((int)__response.StatusCode == 404) @@ -431,18 +429,17 @@ partial void ProcessUnarchiveAgentResponseContent( __exception_404 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_404, - statusCode: __response.StatusCode) - { - ResponseBody = __content_404, - ResponseObject = __value_404, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Rate limit exceeded. Response includes `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` headers. if ((int)__response.StatusCode == 429) @@ -469,18 +466,17 @@ partial void ProcessUnarchiveAgentResponseContent( __exception_429 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_429 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_429, - statusCode: __response.StatusCode) - { - ResponseBody = __content_429, - ResponseObject = __value_429, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_429, + responseObject: __value_429, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } // Internal server error. if ((int)__response.StatusCode == 500) @@ -507,18 +503,17 @@ partial void ProcessUnarchiveAgentResponseContent( __exception_500 = __ex; } - throw new global::CursorAgents.ApiException( + + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, innerException: __exception_500, - statusCode: __response.StatusCode) - { - ResponseBody = __content_500, - ResponseObject = __value_500, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } if (__effectiveReadResponseAsString) @@ -552,17 +547,15 @@ partial void ProcessUnarchiveAgentResponseContent( } catch (global::System.Exception __ex) { - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } else @@ -599,17 +592,15 @@ partial void ProcessUnarchiveAgentResponseContent( { } - throw new global::CursorAgents.ApiException( + throw global::CursorAgents.ApiException.Create( + statusCode: __response.StatusCode, message: __content ?? __response.ReasonPhrase ?? string.Empty, innerException: __ex, - statusCode: __response.StatusCode) - { - ResponseBody = __content, - ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( __response.Headers, h => h.Key, - h => h.Value), - }; + h => h.Value)); } } diff --git a/src/libs/CursorAgents/Generated/CursorAgents.Exceptions.g.cs b/src/libs/CursorAgents/Generated/CursorAgents.Exceptions.g.cs index 496010f..145ac88 100644 --- a/src/libs/CursorAgents/Generated/CursorAgents.Exceptions.g.cs +++ b/src/libs/CursorAgents/Generated/CursorAgents.Exceptions.g.cs @@ -12,16 +12,19 @@ public partial class ApiException : global::System.Exception /// The HTTP status code of the response. /// public global::System.Net.HttpStatusCode StatusCode { get; } + /// /// The response body as a string, or null if the body could not be read. /// This is always populated for error responses regardless of the ReadResponseAsString setting. /// For success-path failures (e.g. deserialization errors), the client attempts a best-effort read. /// public string? ResponseBody { get; set; } + /// /// The response headers. /// public global::System.Collections.Generic.Dictionary>? ResponseHeaders { get; set; } + /// /// Initializes a new instance of the class. /// @@ -49,6 +52,103 @@ public ApiException(string message, global::System.Exception? innerException, gl { StatusCode = statusCode; } + + /// + /// Constructs an instance whose runtime type matches the response status code when the typed exception hierarchy is enabled. Always returns a plain when the hierarchy is disabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static global::CursorAgents.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::CursorAgents.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::CursorAgents.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::CursorAgents.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseHeaders = responseHeaders; + return exception; + } + + /// + /// Parses a Retry-After response header (delta-seconds or HTTP-date) into a . + /// Returns null when the header is missing or unparseable. Public so consumer code that observes + /// directly can recover the value without re-implementing the parser. + /// + public static global::System.TimeSpan? TryParseRetryAfter( + global::System.Collections.Generic.IDictionary>? headers) + { + if (headers == null) + { + return null; + } + + global::System.Collections.Generic.IEnumerable? values = null; + foreach (var entry in headers) + { + if (string.Equals(entry.Key, "Retry-After", global::System.StringComparison.OrdinalIgnoreCase)) + { + values = entry.Value; + break; + } + } + + if (values == null) + { + return null; + } + + string? raw = null; + foreach (var value in values) + { + if (!string.IsNullOrWhiteSpace(value)) + { + raw = value.Trim(); + break; + } + } + + if (string.IsNullOrEmpty(raw)) + { + return null; + } + + if (int.TryParse( + raw, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var seconds) && seconds >= 0) + { + return global::System.TimeSpan.FromSeconds(seconds); + } + + if (global::System.DateTimeOffset.TryParse( + raw, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var when)) + { + var delta = when - global::System.DateTimeOffset.UtcNow; + return delta > global::System.TimeSpan.Zero ? delta : global::System.TimeSpan.Zero; + } + + return null; + } } /// @@ -88,5 +188,39 @@ public ApiException(string message, global::System.Net.HttpStatusCode statusCode public ApiException(string message, global::System.Exception? innerException, global::System.Net.HttpStatusCode statusCode) : base(message, innerException, statusCode) { } + + /// + /// Constructs an whose runtime type matches the response status code when the typed exception hierarchy is enabled. + /// + /// The HTTP status code of the response. + /// The error message. + /// An inner exception, when one is available. + /// The response headers; consulted for 429 Retry-After parsing when present. + public static new global::CursorAgents.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::CursorAgents.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::CursorAgents.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + T? responseObject, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::CursorAgents.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file