From ce4d2a0d615861ebd0ab140a9dea0a47c8f2a632 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 24 May 2026 06:29:05 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Braintrust.AclsClient.AclBatchUpdate.g.cs | 99 ++++++------- .../Braintrust.AclsClient.AclListOrg.g.cs | 99 ++++++------- .../Braintrust.AclsClient.DeleteAcl.g.cs | 99 ++++++------- .../Braintrust.AclsClient.DeleteAclId.g.cs | 99 ++++++------- .../Braintrust.AclsClient.GetAcl.g.cs | 99 ++++++------- .../Braintrust.AclsClient.GetAclId.g.cs | 99 ++++++------- .../Braintrust.AclsClient.PostAcl.g.cs | 99 ++++++------- ...ntrust.AiSecretsClient.DeleteAiSecret.g.cs | 99 ++++++------- ...rust.AiSecretsClient.DeleteAiSecretId.g.cs | 99 ++++++------- ...raintrust.AiSecretsClient.GetAiSecret.g.cs | 99 ++++++------- ...intrust.AiSecretsClient.GetAiSecretId.g.cs | 99 ++++++------- ...trust.AiSecretsClient.PatchAiSecretId.g.cs | 99 ++++++------- ...aintrust.AiSecretsClient.PostAiSecret.g.cs | 99 ++++++------- ...raintrust.AiSecretsClient.PutAiSecret.g.cs | 99 ++++++------- ...aintrust.ApiKeysClient.DeleteApiKeyId.g.cs | 99 ++++++------- .../Braintrust.ApiKeysClient.GetApiKey.g.cs | 99 ++++++------- .../Braintrust.ApiKeysClient.GetApiKeyId.g.cs | 99 ++++++------- .../Braintrust.CorsClient.OptionsAcl.g.cs | 39 +++-- ...rust.CorsClient.OptionsAclBatchUpdate.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsAclId.g.cs | 39 +++-- ...aintrust.CorsClient.OptionsAclListOrg.g.cs | 39 +++-- ...Braintrust.CorsClient.OptionsAiSecret.g.cs | 39 +++-- ...aintrust.CorsClient.OptionsAiSecretId.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsApiKey.g.cs | 39 +++-- ...Braintrust.CorsClient.OptionsApiKeyId.g.cs | 39 +++-- ...t.CorsClient.OptionsCrossObjectInsert.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsDataset.g.cs | 39 +++-- ...raintrust.CorsClient.OptionsDatasetId.g.cs | 39 +++-- ...t.CorsClient.OptionsDatasetIdFeedback.g.cs | 39 +++-- ...rust.CorsClient.OptionsDatasetIdFetch.g.cs | 39 +++-- ...ust.CorsClient.OptionsDatasetIdInsert.g.cs | 39 +++-- ....CorsClient.OptionsDatasetIdSummarize.g.cs | 39 +++-- ...ust.CorsClient.OptionsDatasetSnapshot.g.cs | 39 +++-- ...t.CorsClient.OptionsDatasetSnapshotId.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsEnvVar.g.cs | 39 +++-- ...Braintrust.CorsClient.OptionsEnvVarId.g.cs | 39 +++-- ...aintrust.CorsClient.OptionsExperiment.g.cs | 39 +++-- ...ntrust.CorsClient.OptionsExperimentId.g.cs | 39 +++-- ...orsClient.OptionsExperimentIdFeedback.g.cs | 39 +++-- ...t.CorsClient.OptionsExperimentIdFetch.g.cs | 39 +++-- ....CorsClient.OptionsExperimentIdInsert.g.cs | 39 +++-- ...rsClient.OptionsExperimentIdSummarize.g.cs | 39 +++-- ...Braintrust.CorsClient.OptionsFunction.g.cs | 39 +++-- ...aintrust.CorsClient.OptionsFunctionId.g.cs | 39 +++-- ...st.CorsClient.OptionsFunctionIdInvoke.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsGroup.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsGroupId.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsIndex.g.cs | 39 +++-- ...raintrust.CorsClient.OptionsMcpServer.g.cs | 39 +++-- ...intrust.CorsClient.OptionsMcpServerId.g.cs | 39 +++-- ...ntrust.CorsClient.OptionsOrganization.g.cs | 39 +++-- ...rust.CorsClient.OptionsOrganizationId.g.cs | 39 +++-- ...CorsClient.OptionsOrganizationMembers.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsProject.g.cs | 39 +++-- ...t.CorsClient.OptionsProjectAutomation.g.cs | 39 +++-- ...CorsClient.OptionsProjectAutomationId.g.cs | 39 +++-- ...raintrust.CorsClient.OptionsProjectId.g.cs | 39 +++-- ...rsClient.OptionsProjectLogsIdFeedback.g.cs | 39 +++-- ....CorsClient.OptionsProjectLogsIdFetch.g.cs | 39 +++-- ...CorsClient.OptionsProjectLogsIdInsert.g.cs | 39 +++-- ...ntrust.CorsClient.OptionsProjectScore.g.cs | 39 +++-- ...rust.CorsClient.OptionsProjectScoreId.g.cs | 39 +++-- ...aintrust.CorsClient.OptionsProjectTag.g.cs | 39 +++-- ...ntrust.CorsClient.OptionsProjectTagId.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsPrompt.g.cs | 39 +++-- ...Braintrust.CorsClient.OptionsPromptId.g.cs | 39 +++-- ...rust.CorsClient.OptionsProxyproxyauto.g.cs | 39 +++-- ...ient.OptionsProxyproxychatCompletions.g.cs | 39 +++-- ...rsClient.OptionsProxyproxycompletions.g.cs | 39 +++-- ...rsClient.OptionsProxyproxycredentials.g.cs | 39 +++-- ...orsClient.OptionsProxyproxyembeddings.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsRole.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsRoleId.g.cs | 39 +++-- ...ntrust.CorsClient.OptionsServiceToken.g.cs | 39 +++-- ...rust.CorsClient.OptionsServiceTokenId.g.cs | 39 +++-- ...aintrust.CorsClient.OptionsSpanIframe.g.cs | 39 +++-- ...ntrust.CorsClient.OptionsSpanIframeId.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsUser.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsUserId.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsView.g.cs | 39 +++-- .../Braintrust.CorsClient.OptionsViewId.g.cs | 39 +++-- ...ossObjectClient.PostCrossObjectInsert.g.cs | 99 ++++++------- ...apshotsClient.DeleteDatasetSnapshotId.g.cs | 99 ++++++------- ...setSnapshotsClient.GetDatasetSnapshot.g.cs | 99 ++++++------- ...tSnapshotsClient.GetDatasetSnapshotId.g.cs | 99 ++++++------- ...napshotsClient.PatchDatasetSnapshotId.g.cs | 99 ++++++------- ...etSnapshotsClient.PostDatasetSnapshot.g.cs | 99 ++++++------- ...setSnapshotsClient.PutDatasetSnapshot.g.cs | 99 ++++++------- ...ntrust.DatasetsClient.DeleteDatasetId.g.cs | 99 ++++++------- .../Braintrust.DatasetsClient.GetDataset.g.cs | 99 ++++++------- ...raintrust.DatasetsClient.GetDatasetId.g.cs | 99 ++++++------- ...rust.DatasetsClient.GetDatasetIdFetch.g.cs | 99 ++++++------- ....DatasetsClient.GetDatasetIdSummarize.g.cs | 99 ++++++------- ...intrust.DatasetsClient.PatchDatasetId.g.cs | 99 ++++++------- ...Braintrust.DatasetsClient.PostDataset.g.cs | 99 ++++++------- ....DatasetsClient.PostDatasetIdFeedback.g.cs | 99 ++++++------- ...ust.DatasetsClient.PostDatasetIdFetch.g.cs | 99 ++++++------- ...st.DatasetsClient.PostDatasetIdInsert.g.cs | 99 ++++++------- ...aintrust.EnvVarsClient.DeleteEnvVarId.g.cs | 99 ++++++------- .../Braintrust.EnvVarsClient.GetEnvVar.g.cs | 99 ++++++------- .../Braintrust.EnvVarsClient.GetEnvVarId.g.cs | 99 ++++++------- ...raintrust.EnvVarsClient.PatchEnvVarId.g.cs | 99 ++++++------- .../Braintrust.EnvVarsClient.PostEnvVar.g.cs | 99 ++++++------- .../Braintrust.EnvVarsClient.PutEnvVar.g.cs | 99 ++++++------- ....EnvironmentsClient.CreateEnvironment.g.cs | 99 ++++++------- ....EnvironmentsClient.DeleteEnvironment.g.cs | 99 ++++++------- ...ust.EnvironmentsClient.GetEnvironment.g.cs | 99 ++++++------- ...t.EnvironmentsClient.ListEnvironments.g.cs | 99 ++++++------- ....EnvironmentsClient.UpdateEnvironment.g.cs | 99 ++++++------- .../Braintrust.EvalsClient.EvalLaunch.g.cs | 24 ++-- .../Generated/Braintrust.Exceptions.g.cs | 134 ++++++++++++++++++ ....ExperimentsClient.DeleteExperimentId.g.cs | 99 ++++++------- ...trust.ExperimentsClient.GetExperiment.g.cs | 99 ++++++------- ...ust.ExperimentsClient.GetExperimentId.g.cs | 99 ++++++------- ...xperimentsClient.GetExperimentIdFetch.g.cs | 99 ++++++------- ...imentsClient.GetExperimentIdSummarize.g.cs | 99 ++++++------- ...t.ExperimentsClient.PatchExperimentId.g.cs | 99 ++++++------- ...rust.ExperimentsClient.PostExperiment.g.cs | 99 ++++++------- ...imentsClient.PostExperimentIdFeedback.g.cs | 99 ++++++------- ...perimentsClient.PostExperimentIdFetch.g.cs | 99 ++++++------- ...erimentsClient.PostExperimentIdInsert.g.cs | 99 ++++++------- ...rust.FunctionsClient.DeleteFunctionId.g.cs | 99 ++++++------- ...raintrust.FunctionsClient.GetFunction.g.cs | 99 ++++++------- ...intrust.FunctionsClient.GetFunctionId.g.cs | 99 ++++++------- ...trust.FunctionsClient.PatchFunctionId.g.cs | 99 ++++++------- ...aintrust.FunctionsClient.PostFunction.g.cs | 99 ++++++------- ....FunctionsClient.PostFunctionIdInvoke.g.cs | 24 ++-- ...raintrust.FunctionsClient.PutFunction.g.cs | 99 ++++++------- ...Braintrust.GroupsClient.DeleteGroupId.g.cs | 99 ++++++------- .../Braintrust.GroupsClient.GetGroup.g.cs | 99 ++++++------- .../Braintrust.GroupsClient.GetGroupId.g.cs | 99 ++++++------- .../Braintrust.GroupsClient.PatchGroupId.g.cs | 99 ++++++------- .../Braintrust.GroupsClient.PostGroup.g.cs | 99 ++++++------- .../Braintrust.GroupsClient.PutGroup.g.cs | 99 ++++++------- ...rust.LogsClient.GetProjectLogsIdFetch.g.cs | 99 ++++++------- ....LogsClient.PostProjectLogsIdFeedback.g.cs | 99 ++++++------- ...ust.LogsClient.PostProjectLogsIdFetch.g.cs | 99 ++++++------- ...st.LogsClient.PostProjectLogsIdInsert.g.cs | 99 ++++++------- ...st.McpServersClient.DeleteMcpServerId.g.cs | 99 ++++++------- ...intrust.McpServersClient.GetMcpServer.g.cs | 99 ++++++------- ...trust.McpServersClient.GetMcpServerId.g.cs | 99 ++++++------- ...ust.McpServersClient.PatchMcpServerId.g.cs | 99 ++++++------- ...ntrust.McpServersClient.PostMcpServer.g.cs | 99 ++++++------- ...intrust.McpServersClient.PutMcpServer.g.cs | 99 ++++++------- ...t.OrganizationsClient.GetOrganization.g.cs | 99 ++++++------- ...OrganizationsClient.GetOrganizationId.g.cs | 99 ++++++------- ...ganizationsClient.PatchOrganizationId.g.cs | 99 ++++++------- ...ationsClient.PatchOrganizationMembers.g.cs | 99 ++++++------- .../Braintrust.OtherClient.GetIndex.g.cs | 54 ++++--- ...tionsClient.DeleteProjectAutomationId.g.cs | 99 ++++++------- ...utomationsClient.GetProjectAutomation.g.cs | 99 ++++++------- ...omationsClient.GetProjectAutomationId.g.cs | 99 ++++++------- ...ationsClient.PatchProjectAutomationId.g.cs | 99 ++++++------- ...tomationsClient.PostProjectAutomation.g.cs | 99 ++++++------- ...utomationsClient.PutProjectAutomation.g.cs | 99 ++++++------- ...jectScoresClient.DeleteProjectScoreId.g.cs | 99 ++++++------- ...t.ProjectScoresClient.GetProjectScore.g.cs | 99 ++++++------- ...ProjectScoresClient.GetProjectScoreId.g.cs | 99 ++++++------- ...ojectScoresClient.PatchProjectScoreId.g.cs | 99 ++++++------- ....ProjectScoresClient.PostProjectScore.g.cs | 99 ++++++------- ...t.ProjectScoresClient.PutProjectScore.g.cs | 99 ++++++------- ....ProjectTagsClient.DeleteProjectTagId.g.cs | 99 ++++++------- ...trust.ProjectTagsClient.GetProjectTag.g.cs | 99 ++++++------- ...ust.ProjectTagsClient.GetProjectTagId.g.cs | 99 ++++++------- ...t.ProjectTagsClient.PatchProjectTagId.g.cs | 99 ++++++------- ...rust.ProjectTagsClient.PostProjectTag.g.cs | 99 ++++++------- ...trust.ProjectTagsClient.PutProjectTag.g.cs | 99 ++++++------- ...ntrust.ProjectsClient.DeleteProjectId.g.cs | 99 ++++++------- .../Braintrust.ProjectsClient.GetProject.g.cs | 99 ++++++------- ...raintrust.ProjectsClient.GetProjectId.g.cs | 99 ++++++------- ...intrust.ProjectsClient.PatchProjectId.g.cs | 99 ++++++------- ...Braintrust.ProjectsClient.PostProject.g.cs | 99 ++++++------- ...aintrust.PromptsClient.DeletePromptId.g.cs | 99 ++++++------- .../Braintrust.PromptsClient.GetPrompt.g.cs | 99 ++++++------- .../Braintrust.PromptsClient.GetPromptId.g.cs | 99 ++++++------- ...raintrust.PromptsClient.PatchPromptId.g.cs | 99 ++++++------- .../Braintrust.PromptsClient.PostPrompt.g.cs | 99 ++++++------- .../Braintrust.PromptsClient.PutPrompt.g.cs | 99 ++++++------- .../Braintrust.ProxyClient.Proxyauto.g.cs | 24 ++-- ...rust.ProxyClient.ProxychatCompletions.g.cs | 24 ++-- ...aintrust.ProxyClient.Proxycompletions.g.cs | 24 ++-- ...aintrust.ProxyClient.Proxycredentials.g.cs | 39 +++-- ...raintrust.ProxyClient.Proxyembeddings.g.cs | 24 ++-- .../Braintrust.RolesClient.DeleteRoleId.g.cs | 99 ++++++------- .../Braintrust.RolesClient.GetRole.g.cs | 99 ++++++------- .../Braintrust.RolesClient.GetRoleId.g.cs | 99 ++++++------- .../Braintrust.RolesClient.PatchRoleId.g.cs | 99 ++++++------- .../Braintrust.RolesClient.PostRole.g.cs | 99 ++++++------- .../Braintrust.RolesClient.PutRole.g.cs | 99 ++++++------- ...erviceTokensClient.DeleteServiceToken.g.cs | 99 ++++++------- ...viceTokensClient.DeleteServiceTokenId.g.cs | 99 ++++++------- ...t.ServiceTokensClient.GetServiceToken.g.cs | 99 ++++++------- ...ServiceTokensClient.GetServiceTokenId.g.cs | 99 ++++++------- ....SpanIframesClient.DeleteSpanIframeId.g.cs | 99 ++++++------- ...trust.SpanIframesClient.GetSpanIframe.g.cs | 99 ++++++------- ...ust.SpanIframesClient.GetSpanIframeId.g.cs | 99 ++++++------- ...t.SpanIframesClient.PatchSpanIframeId.g.cs | 99 ++++++------- ...rust.SpanIframesClient.PostSpanIframe.g.cs | 99 ++++++------- ...trust.SpanIframesClient.PutSpanIframe.g.cs | 99 ++++++------- .../Braintrust.UsersClient.GetUser.g.cs | 99 ++++++------- .../Braintrust.UsersClient.GetUserId.g.cs | 99 ++++++------- .../Braintrust.ViewsClient.DeleteViewId.g.cs | 99 ++++++------- .../Braintrust.ViewsClient.GetView.g.cs | 99 ++++++------- .../Braintrust.ViewsClient.GetViewId.g.cs | 99 ++++++------- .../Braintrust.ViewsClient.PatchViewId.g.cs | 99 ++++++------- .../Braintrust.ViewsClient.PostView.g.cs | 99 ++++++------- .../Braintrust.ViewsClient.PutView.g.cs | 99 ++++++------- 207 files changed, 7353 insertions(+), 8780 deletions(-) diff --git a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs index 2fc5c52..4d36e74 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclBatchUpdate.g.cs @@ -371,18 +371,17 @@ partial void ProcessAclBatchUpdateResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessAclBatchUpdateResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessAclBatchUpdateResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessAclBatchUpdateResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessAclBatchUpdateResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessAclBatchUpdateResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessAclBatchUpdateResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs index d2eb400..b64f7da 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.AclListOrg.g.cs @@ -527,18 +527,17 @@ partial void ProcessAclListOrgResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -565,18 +564,17 @@ partial void ProcessAclListOrgResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -603,18 +601,17 @@ partial void ProcessAclListOrgResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -641,18 +638,17 @@ partial void ProcessAclListOrgResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -679,18 +675,17 @@ partial void ProcessAclListOrgResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -724,17 +719,15 @@ partial void ProcessAclListOrgResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -771,17 +764,15 @@ partial void ProcessAclListOrgResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs index 3018886..92903e4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAcl.g.cs @@ -371,18 +371,17 @@ partial void ProcessDeleteAclResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessDeleteAclResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessDeleteAclResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessDeleteAclResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessDeleteAclResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessDeleteAclResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessDeleteAclResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs index 7d0f960..a508dad 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.DeleteAclId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteAclIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteAclIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteAclIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteAclIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteAclIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteAclIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteAclIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs index ca66939..fce511b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAcl.g.cs @@ -513,18 +513,17 @@ partial void ProcessGetAclResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -551,18 +550,17 @@ partial void ProcessGetAclResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -589,18 +587,17 @@ partial void ProcessGetAclResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -627,18 +624,17 @@ partial void ProcessGetAclResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -665,18 +661,17 @@ partial void ProcessGetAclResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -710,17 +705,15 @@ partial void ProcessGetAclResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -757,17 +750,15 @@ partial void ProcessGetAclResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs index 3167969..e62b936 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.GetAclId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetAclIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetAclIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetAclIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetAclIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetAclIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetAclIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetAclIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs index 8ccebe9..48b41a0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AclsClient.PostAcl.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostAclResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostAclResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostAclResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostAclResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostAclResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostAclResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostAclResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs index bce618b..4675e44 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecret.g.cs @@ -371,18 +371,17 @@ partial void ProcessDeleteAiSecretResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessDeleteAiSecretResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessDeleteAiSecretResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessDeleteAiSecretResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessDeleteAiSecretResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessDeleteAiSecretResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessDeleteAiSecretResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs index 386f611..aea2765 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.DeleteAiSecretId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteAiSecretIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteAiSecretIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteAiSecretIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteAiSecretIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteAiSecretIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteAiSecretIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteAiSecretIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs index da62fff..3d76bdd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecret.g.cs @@ -451,18 +451,17 @@ partial void ProcessGetAiSecretResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -489,18 +488,17 @@ partial void ProcessGetAiSecretResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -527,18 +525,17 @@ partial void ProcessGetAiSecretResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -565,18 +562,17 @@ partial void ProcessGetAiSecretResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -603,18 +599,17 @@ partial void ProcessGetAiSecretResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -648,17 +643,15 @@ partial void ProcessGetAiSecretResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -695,17 +688,15 @@ partial void ProcessGetAiSecretResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs index 8a5f239..42dedca 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.GetAiSecretId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetAiSecretIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetAiSecretIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetAiSecretIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetAiSecretIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetAiSecretIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetAiSecretIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetAiSecretIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs index 8651842..cbf007c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PatchAiSecretId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchAiSecretIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchAiSecretIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchAiSecretIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchAiSecretIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchAiSecretIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchAiSecretIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchAiSecretIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs index eac42f3..6cf1f01 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PostAiSecret.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostAiSecretResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostAiSecretResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostAiSecretResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostAiSecretResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostAiSecretResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostAiSecretResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostAiSecretResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs index e06acba..9068d11 100644 --- a/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.AiSecretsClient.PutAiSecret.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutAiSecretResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutAiSecretResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutAiSecretResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutAiSecretResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutAiSecretResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutAiSecretResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutAiSecretResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs index 2afbd2d..f0050d9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.DeleteApiKeyId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteApiKeyIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteApiKeyIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteApiKeyIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteApiKeyIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteApiKeyIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteApiKeyIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteApiKeyIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs index 1a8ff76..a578a96 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKey.g.cs @@ -443,18 +443,17 @@ partial void ProcessGetApiKeyResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -481,18 +480,17 @@ partial void ProcessGetApiKeyResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -519,18 +517,17 @@ partial void ProcessGetApiKeyResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -557,18 +554,17 @@ partial void ProcessGetApiKeyResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -595,18 +591,17 @@ partial void ProcessGetApiKeyResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -640,17 +635,15 @@ partial void ProcessGetApiKeyResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -687,17 +680,15 @@ partial void ProcessGetApiKeyResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs index 4626839..f04dd32 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ApiKeysClient.GetApiKeyId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetApiKeyIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetApiKeyIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetApiKeyIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetApiKeyIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetApiKeyIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetApiKeyIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetApiKeyIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs index 59aec48..ca25fff 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAcl.g.cs @@ -292,18 +292,17 @@ await OptionsAclAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsAclAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsAclAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs index ff0ed26..debcbde 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclBatchUpdate.g.cs @@ -292,18 +292,17 @@ await OptionsAclBatchUpdateAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsAclBatchUpdateAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsAclBatchUpdateAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs index ec2614c..850fd3f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclId.g.cs @@ -305,18 +305,17 @@ await OptionsAclIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsAclIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsAclIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs index 874e785..62a8bb8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAclListOrg.g.cs @@ -292,18 +292,17 @@ await OptionsAclListOrgAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsAclListOrgAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsAclListOrgAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs index 4a6fcca..bf0afd4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecret.g.cs @@ -292,18 +292,17 @@ await OptionsAiSecretAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsAiSecretAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsAiSecretAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs index fd47b1a..4677890 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsAiSecretId.g.cs @@ -305,18 +305,17 @@ await OptionsAiSecretIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsAiSecretIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsAiSecretIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs index 3b6ff2c..9907839 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKey.g.cs @@ -292,18 +292,17 @@ await OptionsApiKeyAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsApiKeyAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsApiKeyAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs index 0bce34b..e94f82c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsApiKeyId.g.cs @@ -305,18 +305,17 @@ await OptionsApiKeyIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsApiKeyIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsApiKeyIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs index aa03605..d090b1d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsCrossObjectInsert.g.cs @@ -292,18 +292,17 @@ await OptionsCrossObjectInsertAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsCrossObjectInsertAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsCrossObjectInsertAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs index 8e01b09..a236b72 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDataset.g.cs @@ -292,18 +292,17 @@ await OptionsDatasetAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsDatasetAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsDatasetAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs index b2d2b45..c5cfbdd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetId.g.cs @@ -305,18 +305,17 @@ await OptionsDatasetIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsDatasetIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsDatasetIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs index ebec529..9f10a09 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFeedback.g.cs @@ -305,18 +305,17 @@ await OptionsDatasetIdFeedbackAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsDatasetIdFeedbackAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsDatasetIdFeedbackAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs index 1d39d29..4b3ff7e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdFetch.g.cs @@ -305,18 +305,17 @@ await OptionsDatasetIdFetchAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsDatasetIdFetchAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsDatasetIdFetchAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs index b98c0f6..6b97dce 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdInsert.g.cs @@ -305,18 +305,17 @@ await OptionsDatasetIdInsertAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsDatasetIdInsertAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsDatasetIdInsertAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs index 7cc7fe0..1ab0f65 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetIdSummarize.g.cs @@ -305,18 +305,17 @@ await OptionsDatasetIdSummarizeAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsDatasetIdSummarizeAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsDatasetIdSummarizeAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs index 9f16fee..fac8180 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshot.g.cs @@ -292,18 +292,17 @@ await OptionsDatasetSnapshotAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsDatasetSnapshotAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsDatasetSnapshotAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs index 57a26bb..7dce622 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsDatasetSnapshotId.g.cs @@ -305,18 +305,17 @@ await OptionsDatasetSnapshotIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsDatasetSnapshotIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsDatasetSnapshotIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs index 9b31c6f..34a9781 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVar.g.cs @@ -292,18 +292,17 @@ await OptionsEnvVarAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsEnvVarAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsEnvVarAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs index 89fed14..08699c0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsEnvVarId.g.cs @@ -305,18 +305,17 @@ await OptionsEnvVarIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsEnvVarIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsEnvVarIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs index e2081e2..40033e4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperiment.g.cs @@ -292,18 +292,17 @@ await OptionsExperimentAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsExperimentAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsExperimentAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs index 0d54b06..0010b95 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentId.g.cs @@ -305,18 +305,17 @@ await OptionsExperimentIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsExperimentIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsExperimentIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs index e7c9952..42da236 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFeedback.g.cs @@ -305,18 +305,17 @@ await OptionsExperimentIdFeedbackAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsExperimentIdFeedbackAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsExperimentIdFeedbackAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs index a293a45..d3d5d6a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdFetch.g.cs @@ -305,18 +305,17 @@ await OptionsExperimentIdFetchAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsExperimentIdFetchAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsExperimentIdFetchAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs index 27c4f93..dd2eb53 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdInsert.g.cs @@ -305,18 +305,17 @@ await OptionsExperimentIdInsertAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsExperimentIdInsertAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsExperimentIdInsertAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs index 70e8279..54e2997 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsExperimentIdSummarize.g.cs @@ -305,18 +305,17 @@ await OptionsExperimentIdSummarizeAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsExperimentIdSummarizeAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsExperimentIdSummarizeAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs index 2ef1ade..395c6e2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunction.g.cs @@ -292,18 +292,17 @@ await OptionsFunctionAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsFunctionAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsFunctionAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs index 7470e35..cd906f1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionId.g.cs @@ -305,18 +305,17 @@ await OptionsFunctionIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsFunctionIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsFunctionIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs index 975767d..bfb97b5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsFunctionIdInvoke.g.cs @@ -305,18 +305,17 @@ await OptionsFunctionIdInvokeAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsFunctionIdInvokeAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsFunctionIdInvokeAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs index 1e3d14b..f214d6e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroup.g.cs @@ -292,18 +292,17 @@ await OptionsGroupAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsGroupAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsGroupAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs index 25e5430..ae56c2a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsGroupId.g.cs @@ -305,18 +305,17 @@ await OptionsGroupIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsGroupIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsGroupIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs index 9364900..628005c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsIndex.g.cs @@ -292,18 +292,17 @@ await OptionsIndexAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsIndexAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsIndexAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs index df14f11..e586c7d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServer.g.cs @@ -292,18 +292,17 @@ await OptionsMcpServerAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsMcpServerAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsMcpServerAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs index fc5cb2e..de2f5fc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsMcpServerId.g.cs @@ -305,18 +305,17 @@ await OptionsMcpServerIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsMcpServerIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsMcpServerIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs index bce6622..be05633 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganization.g.cs @@ -292,18 +292,17 @@ await OptionsOrganizationAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsOrganizationAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsOrganizationAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs index aa40498..c003d93 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationId.g.cs @@ -305,18 +305,17 @@ await OptionsOrganizationIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsOrganizationIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsOrganizationIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs index 52ca469..18d3f98 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsOrganizationMembers.g.cs @@ -292,18 +292,17 @@ await OptionsOrganizationMembersAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsOrganizationMembersAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsOrganizationMembersAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs index 311767f..150a95b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProject.g.cs @@ -292,18 +292,17 @@ await OptionsProjectAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProjectAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProjectAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs index ac3c45b..0b1883c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomation.g.cs @@ -292,18 +292,17 @@ await OptionsProjectAutomationAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProjectAutomationAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProjectAutomationAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs index 325c0f8..e846eb6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectAutomationId.g.cs @@ -305,18 +305,17 @@ await OptionsProjectAutomationIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectAutomationIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectAutomationIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs index d4d8b69..8a424c2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectId.g.cs @@ -305,18 +305,17 @@ await OptionsProjectIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs index d2b9062..776f139 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFeedback.g.cs @@ -305,18 +305,17 @@ await OptionsProjectLogsIdFeedbackAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectLogsIdFeedbackAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectLogsIdFeedbackAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs index 0c8fb1c..3af4772 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdFetch.g.cs @@ -305,18 +305,17 @@ await OptionsProjectLogsIdFetchAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectLogsIdFetchAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectLogsIdFetchAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs index 85c127e..436484f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectLogsIdInsert.g.cs @@ -305,18 +305,17 @@ await OptionsProjectLogsIdInsertAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectLogsIdInsertAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectLogsIdInsertAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs index 473a5db..11d12a4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScore.g.cs @@ -292,18 +292,17 @@ await OptionsProjectScoreAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProjectScoreAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProjectScoreAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs index cf5b130..dceead4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectScoreId.g.cs @@ -305,18 +305,17 @@ await OptionsProjectScoreIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectScoreIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectScoreIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs index e5516b4..ea7136f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTag.g.cs @@ -292,18 +292,17 @@ await OptionsProjectTagAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProjectTagAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProjectTagAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs index cb2c2f0..46e4bca 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProjectTagId.g.cs @@ -305,18 +305,17 @@ await OptionsProjectTagIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsProjectTagIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsProjectTagIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs index ec1cd3b..1b91bb4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPrompt.g.cs @@ -292,18 +292,17 @@ await OptionsPromptAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsPromptAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsPromptAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs index 83e6adb..69a5c76 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsPromptId.g.cs @@ -305,18 +305,17 @@ await OptionsPromptIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsPromptIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsPromptIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs index 1394680..71ca6f9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyauto.g.cs @@ -292,18 +292,17 @@ await OptionsProxyproxyautoAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProxyproxyautoAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProxyproxyautoAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs index 9b93258..b515ca5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxychatCompletions.g.cs @@ -292,18 +292,17 @@ await OptionsProxyproxychatCompletionsAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProxyproxychatCompletionsAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProxyproxychatCompletionsAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs index 7a96be7..46b0ea9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycompletions.g.cs @@ -292,18 +292,17 @@ await OptionsProxyproxycompletionsAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProxyproxycompletionsAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProxyproxycompletionsAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs index 2a78651..3856149 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxycredentials.g.cs @@ -292,18 +292,17 @@ await OptionsProxyproxycredentialsAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProxyproxycredentialsAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProxyproxycredentialsAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs index af3018b..69a4ead 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsProxyproxyembeddings.g.cs @@ -292,18 +292,17 @@ await OptionsProxyproxyembeddingsAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsProxyproxyembeddingsAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsProxyproxyembeddingsAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs index 2f33930..5a974e0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRole.g.cs @@ -292,18 +292,17 @@ await OptionsRoleAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsRoleAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsRoleAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs index 7a63697..c8a7791 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsRoleId.g.cs @@ -305,18 +305,17 @@ await OptionsRoleIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsRoleIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsRoleIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs index 28d4411..53d8f58 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceToken.g.cs @@ -292,18 +292,17 @@ await OptionsServiceTokenAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsServiceTokenAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsServiceTokenAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs index 2b95327..4268c57 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsServiceTokenId.g.cs @@ -305,18 +305,17 @@ await OptionsServiceTokenIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsServiceTokenIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsServiceTokenIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs index cde2e30..b552d3a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframe.g.cs @@ -292,18 +292,17 @@ await OptionsSpanIframeAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsSpanIframeAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsSpanIframeAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs index e1f665f..1e4078b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsSpanIframeId.g.cs @@ -305,18 +305,17 @@ await OptionsSpanIframeIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsSpanIframeIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsSpanIframeIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs index e8fd5bb..f1ff1be 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUser.g.cs @@ -292,18 +292,17 @@ await OptionsUserAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsUserAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsUserAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs index 84ecee3..472e04d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsUserId.g.cs @@ -305,18 +305,17 @@ await OptionsUserIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsUserIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsUserIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs index 67cc092..ed1b823 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsView.g.cs @@ -292,18 +292,17 @@ await OptionsViewAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -330,17 +329,15 @@ await OptionsViewAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -368,17 +365,15 @@ await OptionsViewAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs index b151770..cd75c1d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CorsClient.OptionsViewId.g.cs @@ -305,18 +305,17 @@ await OptionsViewIdAsResponseAsync( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -343,17 +342,15 @@ await OptionsViewIdAsResponseAsync( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -381,17 +378,15 @@ await OptionsViewIdAsResponseAsync( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs index 842d58a..3dc88fd 100644 --- a/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.CrossObjectClient.PostCrossObjectInsert.g.cs @@ -364,18 +364,17 @@ partial void ProcessPostCrossObjectInsertResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessPostCrossObjectInsertResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessPostCrossObjectInsertResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessPostCrossObjectInsertResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessPostCrossObjectInsertResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessPostCrossObjectInsertResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessPostCrossObjectInsertResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs index 657093d..66da889 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.DeleteDatasetSnapshotId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteDatasetSnapshotIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs index 466b0fa..1c0583d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshot.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetDatasetSnapshotResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetDatasetSnapshotResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetDatasetSnapshotResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetDatasetSnapshotResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetDatasetSnapshotResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetDatasetSnapshotResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetDatasetSnapshotResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs index a4b23e2..84712e8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.GetDatasetSnapshotId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetDatasetSnapshotIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs index f3dc606..f45a3a2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PatchDatasetSnapshotId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchDatasetSnapshotIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs index cd74ad3..7f77a92 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PostDatasetSnapshot.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostDatasetSnapshotResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostDatasetSnapshotResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostDatasetSnapshotResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostDatasetSnapshotResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostDatasetSnapshotResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostDatasetSnapshotResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostDatasetSnapshotResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs index d5dfc77..701f7d6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetSnapshotsClient.PutDatasetSnapshot.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutDatasetSnapshotResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutDatasetSnapshotResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutDatasetSnapshotResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutDatasetSnapshotResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutDatasetSnapshotResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutDatasetSnapshotResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutDatasetSnapshotResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs index a4359ff..858f5ec 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.DeleteDatasetId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteDatasetIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteDatasetIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteDatasetIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteDatasetIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteDatasetIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteDatasetIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteDatasetIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs index 544e3d6..e890f12 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDataset.g.cs @@ -469,18 +469,17 @@ partial void ProcessGetDatasetResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -507,18 +506,17 @@ partial void ProcessGetDatasetResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -545,18 +543,17 @@ partial void ProcessGetDatasetResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -583,18 +580,17 @@ partial void ProcessGetDatasetResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -621,18 +617,17 @@ partial void ProcessGetDatasetResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -666,17 +661,15 @@ partial void ProcessGetDatasetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -713,17 +706,15 @@ partial void ProcessGetDatasetResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs index e3c68d0..0f4c7e5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetDatasetIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetDatasetIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetDatasetIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetDatasetIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetDatasetIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetDatasetIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetDatasetIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs index 8bc3c54..b26ed15 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdFetch.g.cs @@ -436,18 +436,17 @@ partial void ProcessGetDatasetIdFetchResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -474,18 +473,17 @@ partial void ProcessGetDatasetIdFetchResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -512,18 +510,17 @@ partial void ProcessGetDatasetIdFetchResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -550,18 +547,17 @@ partial void ProcessGetDatasetIdFetchResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -588,18 +584,17 @@ partial void ProcessGetDatasetIdFetchResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -633,17 +628,15 @@ partial void ProcessGetDatasetIdFetchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -680,17 +673,15 @@ partial void ProcessGetDatasetIdFetchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs index 852fb13..11832d4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.GetDatasetIdSummarize.g.cs @@ -373,18 +373,17 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -411,18 +410,17 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -449,18 +447,17 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -487,18 +484,17 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -525,18 +521,17 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -570,17 +565,15 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -617,17 +610,15 @@ partial void ProcessGetDatasetIdSummarizeResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs index 9abdd36..a8a325e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PatchDatasetId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchDatasetIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchDatasetIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchDatasetIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchDatasetIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchDatasetIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchDatasetIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchDatasetIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs index 0f04b5c..d9a44b1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDataset.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostDatasetResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostDatasetResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostDatasetResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostDatasetResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostDatasetResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostDatasetResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostDatasetResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs index 7bdf373..b689c9d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFeedback.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostDatasetIdFeedbackResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs index d6debe2..d910f24 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdFetch.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostDatasetIdFetchResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostDatasetIdFetchResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostDatasetIdFetchResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostDatasetIdFetchResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostDatasetIdFetchResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostDatasetIdFetchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostDatasetIdFetchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs index 9f561b3..cf43c06 100644 --- a/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.DatasetsClient.PostDatasetIdInsert.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostDatasetIdInsertResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostDatasetIdInsertResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostDatasetIdInsertResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostDatasetIdInsertResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostDatasetIdInsertResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostDatasetIdInsertResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostDatasetIdInsertResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs index b175132..e31eae9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.DeleteEnvVarId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteEnvVarIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteEnvVarIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteEnvVarIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteEnvVarIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteEnvVarIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteEnvVarIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteEnvVarIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs index a8381e0..0ab955a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVar.g.cs @@ -423,18 +423,17 @@ partial void ProcessGetEnvVarResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -461,18 +460,17 @@ partial void ProcessGetEnvVarResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -499,18 +497,17 @@ partial void ProcessGetEnvVarResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -537,18 +534,17 @@ partial void ProcessGetEnvVarResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -575,18 +571,17 @@ partial void ProcessGetEnvVarResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -620,17 +615,15 @@ partial void ProcessGetEnvVarResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -667,17 +660,15 @@ partial void ProcessGetEnvVarResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs index 969ef26..d9949de 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.GetEnvVarId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetEnvVarIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetEnvVarIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetEnvVarIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetEnvVarIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetEnvVarIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetEnvVarIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetEnvVarIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs index cfffa5c..0e8c4fb 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PatchEnvVarId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchEnvVarIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchEnvVarIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchEnvVarIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchEnvVarIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchEnvVarIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchEnvVarIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchEnvVarIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs index c4937bd..7f98ed0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PostEnvVar.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostEnvVarResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostEnvVarResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostEnvVarResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostEnvVarResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostEnvVarResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostEnvVarResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostEnvVarResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs index eac2ab8..c24d945 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvVarsClient.PutEnvVar.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutEnvVarResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutEnvVarResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutEnvVarResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutEnvVarResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutEnvVarResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutEnvVarResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutEnvVarResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs index 3e4f393..1cd7ab7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.CreateEnvironment.g.cs @@ -371,18 +371,17 @@ partial void ProcessCreateEnvironmentResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessCreateEnvironmentResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessCreateEnvironmentResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessCreateEnvironmentResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessCreateEnvironmentResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessCreateEnvironmentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessCreateEnvironmentResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs index 4272b80..a1aaa1e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.DeleteEnvironment.g.cs @@ -358,18 +358,17 @@ partial void ProcessDeleteEnvironmentResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -396,18 +395,17 @@ partial void ProcessDeleteEnvironmentResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -434,18 +432,17 @@ partial void ProcessDeleteEnvironmentResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -472,18 +469,17 @@ partial void ProcessDeleteEnvironmentResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -510,18 +506,17 @@ partial void ProcessDeleteEnvironmentResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -555,17 +550,15 @@ partial void ProcessDeleteEnvironmentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -602,17 +595,15 @@ partial void ProcessDeleteEnvironmentResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs index 5749096..97afddc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.GetEnvironment.g.cs @@ -358,18 +358,17 @@ partial void ProcessGetEnvironmentResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -396,18 +395,17 @@ partial void ProcessGetEnvironmentResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -434,18 +432,17 @@ partial void ProcessGetEnvironmentResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -472,18 +469,17 @@ partial void ProcessGetEnvironmentResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -510,18 +506,17 @@ partial void ProcessGetEnvironmentResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -555,17 +550,15 @@ partial void ProcessGetEnvironmentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -602,17 +595,15 @@ partial void ProcessGetEnvironmentResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs index 442ec68..c49013f 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.ListEnvironments.g.cs @@ -391,18 +391,17 @@ partial void ProcessListEnvironmentsResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -429,18 +428,17 @@ partial void ProcessListEnvironmentsResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -467,18 +465,17 @@ partial void ProcessListEnvironmentsResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -505,18 +502,17 @@ partial void ProcessListEnvironmentsResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -543,18 +539,17 @@ partial void ProcessListEnvironmentsResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -588,17 +583,15 @@ partial void ProcessListEnvironmentsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -635,17 +628,15 @@ partial void ProcessListEnvironmentsResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs index 59c6b07..4acad42 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EnvironmentsClient.UpdateEnvironment.g.cs @@ -378,18 +378,17 @@ partial void ProcessUpdateEnvironmentResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -416,18 +415,17 @@ partial void ProcessUpdateEnvironmentResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -454,18 +452,17 @@ partial void ProcessUpdateEnvironmentResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -492,18 +489,17 @@ partial void ProcessUpdateEnvironmentResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -530,18 +526,17 @@ partial void ProcessUpdateEnvironmentResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -575,17 +570,15 @@ partial void ProcessUpdateEnvironmentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -622,17 +615,15 @@ partial void ProcessUpdateEnvironmentResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs b/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs index 2a616c6..e3c26ed 100644 --- a/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.EvalsClient.EvalLaunch.g.cs @@ -378,17 +378,15 @@ partial void ProcessEvalLaunchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -425,17 +423,15 @@ partial void ProcessEvalLaunchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.Exceptions.g.cs b/src/libs/Braintrust/Generated/Braintrust.Exceptions.g.cs index ffd00d2..38bb0ee 100644 --- a/src/libs/Braintrust/Generated/Braintrust.Exceptions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.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::Braintrust.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Braintrust.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body and headers populated. + /// + public static global::Braintrust.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException, + string? responseBody, + global::System.Collections.Generic.Dictionary>? responseHeaders) + { + var exception = global::Braintrust.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::Braintrust.ApiException Create( + global::System.Net.HttpStatusCode statusCode, + string message, + global::System.Exception? innerException = null, + global::System.Collections.Generic.IDictionary>? responseHeaders = null) + { + return new global::Braintrust.ApiException(message, innerException, statusCode); + } + + /// + /// Convenience overload that constructs an with response body, object, and headers populated. + /// + public static global::Braintrust.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::Braintrust.ApiException.Create(statusCode, message, innerException, responseHeaders); + exception.ResponseBody = responseBody; + exception.ResponseObject = responseObject; + exception.ResponseHeaders = responseHeaders; + return exception; + } } } \ No newline at end of file diff --git a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs index 2d43088..1e00033 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.DeleteExperimentId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteExperimentIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteExperimentIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteExperimentIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteExperimentIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteExperimentIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteExperimentIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteExperimentIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs index 3b8e4cf..1607a7e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperiment.g.cs @@ -471,18 +471,17 @@ partial void ProcessGetExperimentResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -509,18 +508,17 @@ partial void ProcessGetExperimentResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -547,18 +545,17 @@ partial void ProcessGetExperimentResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -585,18 +582,17 @@ partial void ProcessGetExperimentResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -623,18 +619,17 @@ partial void ProcessGetExperimentResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -668,17 +663,15 @@ partial void ProcessGetExperimentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -715,17 +708,15 @@ partial void ProcessGetExperimentResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs index 43cb952..3ce6f75 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetExperimentIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetExperimentIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetExperimentIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetExperimentIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetExperimentIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetExperimentIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetExperimentIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs index ad47cb2..7fa53af 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdFetch.g.cs @@ -436,18 +436,17 @@ partial void ProcessGetExperimentIdFetchResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -474,18 +473,17 @@ partial void ProcessGetExperimentIdFetchResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -512,18 +510,17 @@ partial void ProcessGetExperimentIdFetchResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -550,18 +547,17 @@ partial void ProcessGetExperimentIdFetchResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -588,18 +584,17 @@ partial void ProcessGetExperimentIdFetchResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -633,17 +628,15 @@ partial void ProcessGetExperimentIdFetchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -680,17 +673,15 @@ partial void ProcessGetExperimentIdFetchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs index 70c5f6a..67fc9b0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.GetExperimentIdSummarize.g.cs @@ -387,18 +387,17 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -425,18 +424,17 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -463,18 +461,17 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -501,18 +498,17 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -539,18 +535,17 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -584,17 +579,15 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -631,17 +624,15 @@ partial void ProcessGetExperimentIdSummarizeResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs index c6bbdf6..16eef26 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PatchExperimentId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchExperimentIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchExperimentIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchExperimentIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchExperimentIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchExperimentIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchExperimentIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchExperimentIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs index 96defde..3a492e6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperiment.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostExperimentResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostExperimentResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostExperimentResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostExperimentResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostExperimentResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostExperimentResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostExperimentResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs index a5753cf..7251300 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFeedback.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostExperimentIdFeedbackResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs index aacfbb3..19312ca 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdFetch.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostExperimentIdFetchResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostExperimentIdFetchResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostExperimentIdFetchResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostExperimentIdFetchResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostExperimentIdFetchResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostExperimentIdFetchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostExperimentIdFetchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs index ec487d6..57393ed 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ExperimentsClient.PostExperimentIdInsert.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostExperimentIdInsertResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostExperimentIdInsertResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostExperimentIdInsertResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostExperimentIdInsertResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostExperimentIdInsertResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostExperimentIdInsertResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostExperimentIdInsertResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs index e5914ba..2982000 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.DeleteFunctionId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteFunctionIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteFunctionIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteFunctionIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteFunctionIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteFunctionIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteFunctionIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteFunctionIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs index 61fe220..16a27f8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunction.g.cs @@ -515,18 +515,17 @@ partial void ProcessGetFunctionResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -553,18 +552,17 @@ partial void ProcessGetFunctionResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -591,18 +589,17 @@ partial void ProcessGetFunctionResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -629,18 +626,17 @@ partial void ProcessGetFunctionResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -667,18 +663,17 @@ partial void ProcessGetFunctionResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -712,17 +707,15 @@ partial void ProcessGetFunctionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -759,17 +752,15 @@ partial void ProcessGetFunctionResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs index 46b1abb..ebc6c5e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.GetFunctionId.g.cs @@ -398,18 +398,17 @@ partial void ProcessGetFunctionIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -436,18 +435,17 @@ partial void ProcessGetFunctionIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -474,18 +472,17 @@ partial void ProcessGetFunctionIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -512,18 +509,17 @@ partial void ProcessGetFunctionIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -550,18 +546,17 @@ partial void ProcessGetFunctionIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -595,17 +590,15 @@ partial void ProcessGetFunctionIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -642,17 +635,15 @@ partial void ProcessGetFunctionIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs index 1e389af..631625c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PatchFunctionId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchFunctionIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchFunctionIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchFunctionIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchFunctionIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchFunctionIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchFunctionIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchFunctionIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs index ef79d8e..0858171 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunction.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostFunctionResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostFunctionResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostFunctionResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostFunctionResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostFunctionResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostFunctionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostFunctionResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs index cc8a2a9..abdf85a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PostFunctionIdInvoke.g.cs @@ -389,17 +389,15 @@ partial void ProcessPostFunctionIdInvokeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -434,17 +432,15 @@ partial void ProcessPostFunctionIdInvokeResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs index 784788a..2566a97 100644 --- a/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.FunctionsClient.PutFunction.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutFunctionResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutFunctionResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutFunctionResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutFunctionResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutFunctionResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutFunctionResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutFunctionResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs index 5ca344c..1e5b143 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.DeleteGroupId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteGroupIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteGroupIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteGroupIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteGroupIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteGroupIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteGroupIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteGroupIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs index 73353cb..8fdd8c6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroup.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetGroupResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetGroupResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetGroupResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetGroupResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetGroupResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetGroupResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetGroupResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs index 49b12c6..cc04be1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.GetGroupId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetGroupIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetGroupIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetGroupIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetGroupIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetGroupIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetGroupIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetGroupIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs index 87da094..3ee9758 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PatchGroupId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchGroupIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchGroupIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchGroupIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchGroupIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchGroupIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchGroupIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchGroupIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs index 556c46f..71c2dd8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PostGroup.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostGroupResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostGroupResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostGroupResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostGroupResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostGroupResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostGroupResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostGroupResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs index 1d2a99a..2b025d3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.GroupsClient.PutGroup.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutGroupResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutGroupResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutGroupResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutGroupResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutGroupResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutGroupResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutGroupResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs index e02cbcc..10861e3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.GetProjectLogsIdFetch.g.cs @@ -436,18 +436,17 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -474,18 +473,17 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -512,18 +510,17 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -550,18 +547,17 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -588,18 +584,17 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -633,17 +628,15 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -680,17 +673,15 @@ partial void ProcessGetProjectLogsIdFetchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs index a49d566..6d6fcdf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFeedback.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostProjectLogsIdFeedbackResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs index 7ed5837..005c7e1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdFetch.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostProjectLogsIdFetchResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs index 090f61f..b789772 100644 --- a/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.LogsClient.PostProjectLogsIdInsert.g.cs @@ -384,18 +384,17 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPostProjectLogsIdInsertResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs index 88e3c7c..5572df5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.DeleteMcpServerId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteMcpServerIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteMcpServerIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteMcpServerIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteMcpServerIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteMcpServerIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteMcpServerIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteMcpServerIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs index f5d2550..3030a79 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServer.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetMcpServerResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetMcpServerResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetMcpServerResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetMcpServerResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetMcpServerResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetMcpServerResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetMcpServerResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs index d178c36..159520c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.GetMcpServerId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetMcpServerIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetMcpServerIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetMcpServerIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetMcpServerIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetMcpServerIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetMcpServerIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetMcpServerIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs index ab246ef..f2d18d7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PatchMcpServerId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchMcpServerIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchMcpServerIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchMcpServerIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchMcpServerIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchMcpServerIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchMcpServerIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchMcpServerIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs index ded723e..b20b119 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PostMcpServer.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostMcpServerResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostMcpServerResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostMcpServerResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostMcpServerResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostMcpServerResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostMcpServerResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostMcpServerResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs index e28fdde..70b41d9 100644 --- a/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.McpServersClient.PutMcpServer.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutMcpServerResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutMcpServerResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutMcpServerResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutMcpServerResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutMcpServerResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutMcpServerResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutMcpServerResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs index 32c98e9..3f73509 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganization.g.cs @@ -427,18 +427,17 @@ partial void ProcessGetOrganizationResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -465,18 +464,17 @@ partial void ProcessGetOrganizationResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -503,18 +501,17 @@ partial void ProcessGetOrganizationResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -541,18 +538,17 @@ partial void ProcessGetOrganizationResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -579,18 +575,17 @@ partial void ProcessGetOrganizationResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -624,17 +619,15 @@ partial void ProcessGetOrganizationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -671,17 +664,15 @@ partial void ProcessGetOrganizationResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs index 121b106..501f3ea 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.GetOrganizationId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetOrganizationIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetOrganizationIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetOrganizationIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetOrganizationIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetOrganizationIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetOrganizationIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetOrganizationIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs index b879656..99598c0 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchOrganizationIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchOrganizationIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchOrganizationIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchOrganizationIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchOrganizationIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchOrganizationIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchOrganizationIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs index 7cbf91e..a33c95b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OrganizationsClient.PatchOrganizationMembers.g.cs @@ -373,18 +373,17 @@ partial void ProcessPatchOrganizationMembersResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -411,18 +410,17 @@ partial void ProcessPatchOrganizationMembersResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -449,18 +447,17 @@ partial void ProcessPatchOrganizationMembersResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -487,18 +484,17 @@ partial void ProcessPatchOrganizationMembersResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -525,18 +521,17 @@ partial void ProcessPatchOrganizationMembersResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -570,17 +565,15 @@ partial void ProcessPatchOrganizationMembersResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -617,17 +610,15 @@ partial void ProcessPatchOrganizationMembersResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs b/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs index 5e2ffa9..0fc474e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.OtherClient.GetIndex.g.cs @@ -299,18 +299,17 @@ partial void ProcessGetIndexResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -337,18 +336,17 @@ partial void ProcessGetIndexResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -380,17 +378,15 @@ partial void ProcessGetIndexResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -425,17 +421,15 @@ partial void ProcessGetIndexResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs index 3ad1aea..53f0089 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.DeleteProjectAutomationId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteProjectAutomationIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs index cf585f0..4fd7395 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomation.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetProjectAutomationResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetProjectAutomationResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetProjectAutomationResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetProjectAutomationResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetProjectAutomationResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetProjectAutomationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetProjectAutomationResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs index f6d97a2..3e72da6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.GetProjectAutomationId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetProjectAutomationIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetProjectAutomationIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetProjectAutomationIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetProjectAutomationIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetProjectAutomationIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetProjectAutomationIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetProjectAutomationIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs index e43ab7a..d720c3e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PatchProjectAutomationId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchProjectAutomationIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchProjectAutomationIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchProjectAutomationIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs index 819c211..3bf50e4 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PostProjectAutomation.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostProjectAutomationResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostProjectAutomationResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostProjectAutomationResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostProjectAutomationResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostProjectAutomationResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostProjectAutomationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostProjectAutomationResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs index 7d65ea6..ef76c3b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectAutomationsClient.PutProjectAutomation.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutProjectAutomationResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutProjectAutomationResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutProjectAutomationResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutProjectAutomationResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutProjectAutomationResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutProjectAutomationResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutProjectAutomationResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs index d08adf5..9770568 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.DeleteProjectScoreId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteProjectScoreIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteProjectScoreIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteProjectScoreIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs index 1e2c479..790fca6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScore.g.cs @@ -479,18 +479,17 @@ partial void ProcessGetProjectScoreResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -517,18 +516,17 @@ partial void ProcessGetProjectScoreResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -555,18 +553,17 @@ partial void ProcessGetProjectScoreResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -593,18 +590,17 @@ partial void ProcessGetProjectScoreResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -631,18 +627,17 @@ partial void ProcessGetProjectScoreResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -676,17 +671,15 @@ partial void ProcessGetProjectScoreResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -723,17 +716,15 @@ partial void ProcessGetProjectScoreResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs index b45ec85..5e16d99 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.GetProjectScoreId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetProjectScoreIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetProjectScoreIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetProjectScoreIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetProjectScoreIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetProjectScoreIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetProjectScoreIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetProjectScoreIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs index 57bf129..1c2e091 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PatchProjectScoreId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchProjectScoreIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchProjectScoreIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchProjectScoreIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchProjectScoreIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchProjectScoreIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchProjectScoreIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchProjectScoreIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs index b0c0409..c8c14ce 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PostProjectScore.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostProjectScoreResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostProjectScoreResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostProjectScoreResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostProjectScoreResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostProjectScoreResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostProjectScoreResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostProjectScoreResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs index b37bcad..89ae925 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectScoresClient.PutProjectScore.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutProjectScoreResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutProjectScoreResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutProjectScoreResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutProjectScoreResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutProjectScoreResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutProjectScoreResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutProjectScoreResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs index 6de45de..ae24a1b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.DeleteProjectTagId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteProjectTagIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteProjectTagIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteProjectTagIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteProjectTagIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteProjectTagIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteProjectTagIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteProjectTagIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs index 3050d17..116dadc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTag.g.cs @@ -469,18 +469,17 @@ partial void ProcessGetProjectTagResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -507,18 +506,17 @@ partial void ProcessGetProjectTagResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -545,18 +543,17 @@ partial void ProcessGetProjectTagResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -583,18 +580,17 @@ partial void ProcessGetProjectTagResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -621,18 +617,17 @@ partial void ProcessGetProjectTagResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -666,17 +661,15 @@ partial void ProcessGetProjectTagResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -713,17 +706,15 @@ partial void ProcessGetProjectTagResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs index a0aa13c..99f05e8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.GetProjectTagId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetProjectTagIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetProjectTagIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetProjectTagIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetProjectTagIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetProjectTagIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetProjectTagIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetProjectTagIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs index 7220c90..079eb03 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PatchProjectTagId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchProjectTagIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchProjectTagIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchProjectTagIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchProjectTagIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchProjectTagIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchProjectTagIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchProjectTagIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs index 12813f8..fcd2012 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PostProjectTag.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostProjectTagResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostProjectTagResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostProjectTagResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostProjectTagResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostProjectTagResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostProjectTagResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostProjectTagResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs index 2f5f6fd..4b89108 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectTagsClient.PutProjectTag.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutProjectTagResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutProjectTagResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutProjectTagResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutProjectTagResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutProjectTagResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutProjectTagResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutProjectTagResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs index 70e4d23..b718ad3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.DeleteProjectId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteProjectIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteProjectIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteProjectIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteProjectIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteProjectIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteProjectIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteProjectIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs index 2225de4..625ecb1 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProject.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetProjectResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetProjectResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetProjectResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetProjectResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetProjectResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetProjectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetProjectResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs index 7cad8a5..68526ff 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.GetProjectId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetProjectIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetProjectIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetProjectIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetProjectIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetProjectIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetProjectIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetProjectIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs index 33f92cd..423265a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PatchProjectId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchProjectIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchProjectIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchProjectIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchProjectIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchProjectIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchProjectIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchProjectIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs index 6ed0e65..a2df10a 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProjectsClient.PostProject.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostProjectResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostProjectResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostProjectResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostProjectResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostProjectResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostProjectResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostProjectResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs index d6379ff..c231578 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.DeletePromptId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeletePromptIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeletePromptIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeletePromptIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeletePromptIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeletePromptIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeletePromptIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeletePromptIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs index 9d978e7..27ed3ba 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPrompt.g.cs @@ -515,18 +515,17 @@ partial void ProcessGetPromptResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -553,18 +552,17 @@ partial void ProcessGetPromptResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -591,18 +589,17 @@ partial void ProcessGetPromptResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -629,18 +626,17 @@ partial void ProcessGetPromptResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -667,18 +663,17 @@ partial void ProcessGetPromptResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -712,17 +707,15 @@ partial void ProcessGetPromptResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -759,17 +752,15 @@ partial void ProcessGetPromptResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs index 0591c65..381243c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.GetPromptId.g.cs @@ -398,18 +398,17 @@ partial void ProcessGetPromptIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -436,18 +435,17 @@ partial void ProcessGetPromptIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -474,18 +472,17 @@ partial void ProcessGetPromptIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -512,18 +509,17 @@ partial void ProcessGetPromptIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -550,18 +546,17 @@ partial void ProcessGetPromptIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -595,17 +590,15 @@ partial void ProcessGetPromptIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -642,17 +635,15 @@ partial void ProcessGetPromptIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs index 2f1a23a..a8210cf 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PatchPromptId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchPromptIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchPromptIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchPromptIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchPromptIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchPromptIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchPromptIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchPromptIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs index ffd09bb..954a9c5 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PostPrompt.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostPromptResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostPromptResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostPromptResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostPromptResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostPromptResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostPromptResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostPromptResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs index 5b04abf..d5be78d 100644 --- a/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.PromptsClient.PutPrompt.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutPromptResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutPromptResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutPromptResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutPromptResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutPromptResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutPromptResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutPromptResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs index ee249d8..0a58667 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyauto.g.cs @@ -376,17 +376,15 @@ partial void ProcessProxyautoResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -421,17 +419,15 @@ partial void ProcessProxyautoResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs index 296064f..908aa0c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.ProxychatCompletions.g.cs @@ -376,17 +376,15 @@ partial void ProcessProxychatCompletionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -421,17 +419,15 @@ partial void ProcessProxychatCompletionsResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs index 9fbc220..15a75ad 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycompletions.g.cs @@ -376,17 +376,15 @@ partial void ProcessProxycompletionsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -421,17 +419,15 @@ partial void ProcessProxycompletionsResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs index d165669..30512b8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxycredentials.g.cs @@ -371,18 +371,17 @@ partial void ProcessProxycredentialsResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } if (__effectiveReadResponseAsString) @@ -416,17 +415,15 @@ partial void ProcessProxycredentialsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -463,17 +460,15 @@ partial void ProcessProxycredentialsResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs index 4d05b49..49541c6 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ProxyClient.Proxyembeddings.g.cs @@ -376,17 +376,15 @@ partial void ProcessProxyembeddingsResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -421,17 +419,15 @@ partial void ProcessProxyembeddingsResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs index d368f41..acb8e35 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.DeleteRoleId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteRoleIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteRoleIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteRoleIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteRoleIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteRoleIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteRoleIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteRoleIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs index a1f7c0f..bee2ee3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRole.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetRoleResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetRoleResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetRoleResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetRoleResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetRoleResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetRoleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetRoleResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs index 083e5c0..31b6737 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.GetRoleId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetRoleIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetRoleIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetRoleIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetRoleIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetRoleIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetRoleIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetRoleIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs index 2f6f4ea..43d0cb8 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PatchRoleId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchRoleIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchRoleIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchRoleIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchRoleIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchRoleIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchRoleIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchRoleIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs index 7dbdfca..e06919b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PostRole.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostRoleResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostRoleResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostRoleResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostRoleResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostRoleResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostRoleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostRoleResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs index 87d2976..72992fc 100644 --- a/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.RolesClient.PutRole.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutRoleResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutRoleResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutRoleResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutRoleResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutRoleResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutRoleResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutRoleResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs index 2c063f7..6671bde 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceToken.g.cs @@ -371,18 +371,17 @@ partial void ProcessDeleteServiceTokenResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessDeleteServiceTokenResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessDeleteServiceTokenResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessDeleteServiceTokenResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessDeleteServiceTokenResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessDeleteServiceTokenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessDeleteServiceTokenResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs index 122249d..f9d6ad2 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.DeleteServiceTokenId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteServiceTokenIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteServiceTokenIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteServiceTokenIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs index bf365b8..9dce9d7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceToken.g.cs @@ -443,18 +443,17 @@ partial void ProcessGetServiceTokenResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -481,18 +480,17 @@ partial void ProcessGetServiceTokenResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -519,18 +517,17 @@ partial void ProcessGetServiceTokenResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -557,18 +554,17 @@ partial void ProcessGetServiceTokenResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -595,18 +591,17 @@ partial void ProcessGetServiceTokenResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -640,17 +635,15 @@ partial void ProcessGetServiceTokenResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -687,17 +680,15 @@ partial void ProcessGetServiceTokenResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs index 6539980..df2333e 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ServiceTokensClient.GetServiceTokenId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetServiceTokenIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetServiceTokenIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetServiceTokenIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetServiceTokenIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetServiceTokenIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetServiceTokenIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetServiceTokenIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs index 75e4df3..06611af 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.DeleteSpanIframeId.g.cs @@ -364,18 +364,17 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessDeleteSpanIframeIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessDeleteSpanIframeIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessDeleteSpanIframeIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs index b76df4a..c9e8afa 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframe.g.cs @@ -441,18 +441,17 @@ partial void ProcessGetSpanIframeResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -479,18 +478,17 @@ partial void ProcessGetSpanIframeResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -517,18 +515,17 @@ partial void ProcessGetSpanIframeResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -555,18 +552,17 @@ partial void ProcessGetSpanIframeResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -593,18 +589,17 @@ partial void ProcessGetSpanIframeResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -638,17 +633,15 @@ partial void ProcessGetSpanIframeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -685,17 +678,15 @@ partial void ProcessGetSpanIframeResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs index a46790b..4b86d1b 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.GetSpanIframeId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetSpanIframeIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetSpanIframeIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetSpanIframeIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetSpanIframeIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetSpanIframeIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetSpanIframeIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetSpanIframeIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs index bdd6aed..4731493 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PatchSpanIframeId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchSpanIframeIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchSpanIframeIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchSpanIframeIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchSpanIframeIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchSpanIframeIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchSpanIframeIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchSpanIframeIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs index 92d084a..6a00b32 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PostSpanIframe.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostSpanIframeResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostSpanIframeResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostSpanIframeResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostSpanIframeResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostSpanIframeResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostSpanIframeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostSpanIframeResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs index 4491d00..fc0a557 100644 --- a/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.SpanIframesClient.PutSpanIframe.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutSpanIframeResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutSpanIframeResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutSpanIframeResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutSpanIframeResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutSpanIframeResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutSpanIframeResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutSpanIframeResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs index 06fab34..682b594 100644 --- a/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUser.g.cs @@ -469,18 +469,17 @@ partial void ProcessGetUserResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -507,18 +506,17 @@ partial void ProcessGetUserResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -545,18 +543,17 @@ partial void ProcessGetUserResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -583,18 +580,17 @@ partial void ProcessGetUserResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -621,18 +617,17 @@ partial void ProcessGetUserResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -666,17 +661,15 @@ partial void ProcessGetUserResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -713,17 +706,15 @@ partial void ProcessGetUserResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs index 8f64113..762272c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.UsersClient.GetUserId.g.cs @@ -364,18 +364,17 @@ partial void ProcessGetUserIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -402,18 +401,17 @@ partial void ProcessGetUserIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -440,18 +438,17 @@ partial void ProcessGetUserIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -478,18 +475,17 @@ partial void ProcessGetUserIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -516,18 +512,17 @@ partial void ProcessGetUserIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -561,17 +556,15 @@ partial void ProcessGetUserIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -608,17 +601,15 @@ partial void ProcessGetUserIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs index 2e8fd33..f2b415c 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.DeleteViewId.g.cs @@ -384,18 +384,17 @@ partial void ProcessDeleteViewIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessDeleteViewIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessDeleteViewIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessDeleteViewIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessDeleteViewIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessDeleteViewIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessDeleteViewIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs index 025dc6d..a5121f7 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetView.g.cs @@ -469,18 +469,17 @@ partial void ProcessGetViewResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -507,18 +506,17 @@ partial void ProcessGetViewResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -545,18 +543,17 @@ partial void ProcessGetViewResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -583,18 +580,17 @@ partial void ProcessGetViewResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -621,18 +617,17 @@ partial void ProcessGetViewResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -666,17 +661,15 @@ partial void ProcessGetViewResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -713,17 +706,15 @@ partial void ProcessGetViewResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs index 39ec060..ad937e3 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.GetViewId.g.cs @@ -394,18 +394,17 @@ partial void ProcessGetViewIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -432,18 +431,17 @@ partial void ProcessGetViewIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -470,18 +468,17 @@ partial void ProcessGetViewIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -508,18 +505,17 @@ partial void ProcessGetViewIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -546,18 +542,17 @@ partial void ProcessGetViewIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -591,17 +586,15 @@ partial void ProcessGetViewIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -638,17 +631,15 @@ partial void ProcessGetViewIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs index 81d4779..64c0526 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PatchViewId.g.cs @@ -384,18 +384,17 @@ partial void ProcessPatchViewIdResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -422,18 +421,17 @@ partial void ProcessPatchViewIdResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -460,18 +458,17 @@ partial void ProcessPatchViewIdResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -498,18 +495,17 @@ partial void ProcessPatchViewIdResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -536,18 +532,17 @@ partial void ProcessPatchViewIdResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -581,17 +576,15 @@ partial void ProcessPatchViewIdResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -628,17 +621,15 @@ partial void ProcessPatchViewIdResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs index 245c11d..94cbd65 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PostView.g.cs @@ -371,18 +371,17 @@ partial void ProcessPostViewResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPostViewResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPostViewResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPostViewResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPostViewResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPostViewResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPostViewResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs index 30744fb..805cb19 100644 --- a/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs +++ b/src/libs/Braintrust/Generated/Braintrust.ViewsClient.PutView.g.cs @@ -371,18 +371,17 @@ partial void ProcessPutViewResponseContent( __exception_400 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // No valid API key provided if ((int)__response.StatusCode == 401) @@ -409,18 +408,17 @@ partial void ProcessPutViewResponseContent( __exception_401 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // The API key doesn’t have permissions to perform the request if ((int)__response.StatusCode == 403) @@ -447,18 +445,17 @@ partial void ProcessPutViewResponseContent( __exception_403 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Too many requests hit the API too quickly. We recommend an exponential backoff of your requests if ((int)__response.StatusCode == 429) @@ -485,18 +482,17 @@ partial void ProcessPutViewResponseContent( __exception_429 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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)); } // Something went wrong on Braintrust's end. (These are rare.) if ((int)__response.StatusCode == 500) @@ -523,18 +519,17 @@ partial void ProcessPutViewResponseContent( __exception_500 = __ex; } - throw new global::Braintrust.ApiException( + + throw global::Braintrust.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) @@ -568,17 +563,15 @@ partial void ProcessPutViewResponseContent( } catch (global::System.Exception __ex) { - throw new global::Braintrust.ApiException( + throw global::Braintrust.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 @@ -615,17 +608,15 @@ partial void ProcessPutViewResponseContent( { } - throw new global::Braintrust.ApiException( + throw global::Braintrust.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)); } }