From 2c381010a0f33390475436ec275952dcb4d1a5ae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 30 Jun 2026 03:38:27 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../AgentRunsCreateCommandApiCommand.g.cs | 137 ++ .../AgentRunsGetCommandApiCommand.g.cs | 64 + .../AgentRunsListCommandApiCommand.g.cs | 123 ++ .../AgentRunsMessagesCommandApiCommand.g.cs | 99 ++ .../AgentsCreateCommandApiCommand.g.cs | 118 ++ .../AgentsDeleteCommandApiCommand.g.cs | 38 + .../Commands/AgentsGetCommandApiCommand.g.cs | 64 + .../Commands/AgentsListCommandApiCommand.g.cs | 99 ++ .../AgentsUpdateCommandApiCommand.g.cs | 127 ++ .../Commands/DefaultApiGroupCommand.g.cs | 9 + ...ase.BrowserbaseClient.AgentRunsCreate.g.cs | 482 +++++++ ...erbase.BrowserbaseClient.AgentRunsGet.g.cs | 426 ++++++ ...rbase.BrowserbaseClient.AgentRunsList.g.cs | 483 +++++++ ...e.BrowserbaseClient.AgentRunsMessages.g.cs | 468 +++++++ ...erbase.BrowserbaseClient.AgentsCreate.g.cs | 472 +++++++ ...erbase.BrowserbaseClient.AgentsDelete.g.cs | 403 ++++++ ...owserbase.BrowserbaseClient.AgentsGet.g.cs | 426 ++++++ ...wserbase.BrowserbaseClient.AgentsList.g.cs | 463 +++++++ ...erbase.BrowserbaseClient.AgentsUpdate.g.cs | 484 +++++++ ...se.IBrowserbaseClient.AgentRunsCreate.g.cs | 64 + ...rbase.IBrowserbaseClient.AgentRunsGet.g.cs | 32 + ...base.IBrowserbaseClient.AgentRunsList.g.cs | 56 + ....IBrowserbaseClient.AgentRunsMessages.g.cs | 54 + ...rbase.IBrowserbaseClient.AgentsCreate.g.cs | 56 + ...rbase.IBrowserbaseClient.AgentsDelete.g.cs | 32 + ...wserbase.IBrowserbaseClient.AgentsGet.g.cs | 32 + ...serbase.IBrowserbaseClient.AgentsList.g.cs | 48 + ...rbase.IBrowserbaseClient.AgentsUpdate.g.cs | 62 + ...serbase.JsonConverters.AgentRunStatus.g.cs | 53 + ...JsonConverters.AgentRunStatusNullable.g.cs | 60 + ...se.JsonConverters.AgentRunsListStatus.g.cs | 53 + ...onverters.AgentRunsListStatusNullable.g.cs | 60 + ...nsMessagesResponseDataItemMessageRole.g.cs | 53 + ...esResponseDataItemMessageRoleNullable.g.cs | 60 + .../Browserbase.JsonConverters.OneOf2.g.cs | 161 +++ .../Browserbase.JsonSerializerContext.g.cs | 49 +- ...rowserbase.JsonSerializerContextTypes.g.cs | 402 ++++-- .../Browserbase.Models.Agent.Json.g.cs | 141 ++ .../Generated/Browserbase.Models.Agent.g.cs | 101 ++ ...serbase.Models.AgentResultSchema.Json.g.cs | 141 ++ .../Browserbase.Models.AgentResultSchema.g.cs | 19 + .../Browserbase.Models.AgentRun.Json.g.cs | 141 ++ .../Browserbase.Models.AgentRun.g.cs | 186 +++ ...Browserbase.Models.AgentRunCause.Json.g.cs | 141 ++ .../Browserbase.Models.AgentRunCause.g.cs | 58 + ...rowserbase.Models.AgentRunResult.Json.g.cs | 141 ++ .../Browserbase.Models.AgentRunResult.g.cs | 19 + ...base.Models.AgentRunResultSchema.Json.g.cs | 141 ++ ...owserbase.Models.AgentRunResultSchema.g.cs | 19 + .../Browserbase.Models.AgentRunStatus.g.cs | 81 ++ ...se.Models.AgentRunsCreateRequest.Json.g.cs | 141 ++ ...serbase.Models.AgentRunsCreateRequest.g.cs | 91 ++ ...RunsCreateRequestBrowserSettings.Json.g.cs | 141 ++ ...AgentRunsCreateRequestBrowserSettings.g.cs | 66 + ...ateRequestBrowserSettingsContext.Json.g.cs | 141 ++ ...nsCreateRequestBrowserSettingsContext.g.cs | 58 + ...entRunsCreateRequestResultSchema.Json.g.cs | 141 ++ ...ls.AgentRunsCreateRequestResultSchema.g.cs | 19 + ....AgentRunsCreateRequestVariables.Json.g.cs | 141 ++ ...odels.AgentRunsCreateRequestVariables.g.cs | 19 + ...AgentRunsCreateRequestVariables2.Json.g.cs | 141 ++ ...dels.AgentRunsCreateRequestVariables2.g.cs | 58 + ...ase.Models.AgentRunsListResponse.Json.g.cs | 141 ++ ...wserbase.Models.AgentRunsListResponse.g.cs | 70 + ...rowserbase.Models.AgentRunsListStatus.g.cs | 75 + ...Models.AgentRunsMessagesResponse.Json.g.cs | 141 ++ ...base.Models.AgentRunsMessagesResponse.g.cs | 58 + ...gentRunsMessagesResponseDataItem.Json.g.cs | 141 ++ ...els.AgentRunsMessagesResponseDataItem.g.cs | 67 + ...sMessagesResponseDataItemMessage.Json.g.cs | 141 ++ ...ntRunsMessagesResponseDataItemMessage.g.cs | 59 + ...taItemMessageContentVariant2Item.Json.g.cs | 141 ++ ...nseDataItemMessageContentVariant2Item.g.cs | 110 ++ ...mMessageContentVariant2ItemInput.Json.g.cs | 141 ++ ...taItemMessageContentVariant2ItemInput.g.cs | 19 + ...MessageContentVariant2ItemOutput.Json.g.cs | 141 ++ ...aItemMessageContentVariant2ItemOutput.g.cs | 19 + ...nsMessagesResponseDataItemMessageRole.g.cs | 51 + ...rbase.Models.AgentsCreateRequest.Json.g.cs | 141 ++ ...rowserbase.Models.AgentsCreateRequest.g.cs | 69 + ....AgentsCreateRequestResultSchema.Json.g.cs | 141 ++ ...odels.AgentsCreateRequestResultSchema.g.cs | 19 + ...erbase.Models.AgentsListResponse.Json.g.cs | 141 ++ ...Browserbase.Models.AgentsListResponse.g.cs | 70 + ...rbase.Models.AgentsUpdateRequest.Json.g.cs | 141 ++ ...rowserbase.Models.AgentsUpdateRequest.g.cs | 68 + ....AgentsUpdateRequestResultSchema.Json.g.cs | 141 ++ ...odels.AgentsUpdateRequestResultSchema.g.cs | 19 + .../Generated/Browserbase.OneOf.2.Json.g.cs | 141 ++ .../Generated/Browserbase.OneOf.2.g.cs | 294 ++++ src/libs/Browserbase/openapi.yaml | 1229 ++++++++++++++--- 91 files changed, 12659 insertions(+), 328 deletions(-) create mode 100644 src/cli/Browserbase.CLI/Commands/AgentRunsCreateCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentRunsGetCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentRunsListCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentRunsMessagesCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentsCreateCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentsDeleteCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentsGetCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentsListCommandApiCommand.g.cs create mode 100644 src/cli/Browserbase.CLI/Commands/AgentsUpdateCommandApiCommand.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsCreate.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsGet.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsList.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsMessages.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsCreate.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsDelete.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsGet.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsList.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsUpdate.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsCreate.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsGet.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsList.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsMessages.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsCreate.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsDelete.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsGet.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsList.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsUpdate.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatus.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatusNullable.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatus.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatusNullable.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRole.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleNullable.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.JsonConverters.OneOf2.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.Agent.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.Agent.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunStatus.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListStatus.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageRole.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.OneOf.2.Json.g.cs create mode 100644 src/libs/Browserbase/Generated/Browserbase.OneOf.2.g.cs diff --git a/src/cli/Browserbase.CLI/Commands/AgentRunsCreateCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentRunsCreateCommandApiCommand.g.cs new file mode 100644 index 0000000..c8b8121 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentRunsCreateCommandApiCommand.g.cs @@ -0,0 +1,137 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentRunsCreateCommandApiCommand +{ + private static Option AgentId { get; } = new( + name: @"--agent-id") + { + Description = @"Optionally run a specific [custom agent](/reference/api/create-an-agent) you've created by ID. The run will use the agent's `systemPrompt` and `resultSchema` unless overridden.", + }; + + private static Option Task { get; } = new( + name: @"--task") + { + Description = @"A natural language description of the task the agent should accomplish.", + Required = true, + }; + + private static Option ResultSchema { get; } = new( + name: @"--result-schema") + { + Description = @"An optional [JSON Schema](https://json-schema.org/specification) object. If provided, the agent will aim to return a `result` that conforms to this schema when the run completes. Overrides the referenced agent's default `resultSchema` for this run only.", + }; + + private static Option BrowserSettings { get; } = new( + name: @"--browser-settings") + { + Description = @"Browser configuration for the agent's session. When omitted, runner defaults apply.", + }; + + private static Option?> Variables { get; } = new( + name: @"--variables") + { + Description = @"Optional named variables the agent can reference as placeholders, i.e. `%variable%`. Each entry pairs a `value` the placeholder resolves to with an optional `description` that hints to the agent when it should be used. Values are not persisted.", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.AgentRun value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.AgentRun value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agent-runs-create", @"Run an Agent +Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created."); + command.Options.Add(AgentId); + command.Options.Add(Task); + command.Options.Add(ResultSchema); + command.Options.Add(BrowserSettings); + command.Options.Add(Variables); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::Browserbase.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var agentId = CliRuntime.WasSpecified(parseResult, AgentId) ? parseResult.GetValue(AgentId) : (__requestBase is { } __AgentIdBaseValue ? __AgentIdBaseValue.AgentId : default); + var task = parseResult.GetRequiredValue(Task); + var resultSchema = CliRuntime.WasSpecified(parseResult, ResultSchema) ? parseResult.GetValue(ResultSchema) : (__requestBase is { } __ResultSchemaBaseValue ? __ResultSchemaBaseValue.ResultSchema : default); + var browserSettings = CliRuntime.WasSpecified(parseResult, BrowserSettings) ? parseResult.GetValue(BrowserSettings) : (__requestBase is { } __BrowserSettingsBaseValue ? __BrowserSettingsBaseValue.BrowserSettings : default); + var variables = CliRuntime.WasSpecified(parseResult, Variables) ? parseResult.GetValue(Variables) : (__requestBase is { } __VariablesBaseValue ? __VariablesBaseValue.Variables : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentRunsCreateAsync( + agentId: agentId, + task: task, + resultSchema: resultSchema, + browserSettings: browserSettings, + variables: variables, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentRunsGetCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentRunsGetCommandApiCommand.g.cs new file mode 100644 index 0000000..76fce12 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentRunsGetCommandApiCommand.g.cs @@ -0,0 +1,64 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentRunsGetCommandApiCommand +{ + private static Argument RunId { get; } = new( + name: @"run-id") + { + Description = @"The run ID.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.AgentRun value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.AgentRun value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agent-runs-get", @"Get a Run +Retrieve the current status and details of a run, including its result and associated session information. To fetch the run's messages, use [List Run Messages](/reference/api/list-run-messages)."); + command.Arguments.Add(RunId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var runId = parseResult.GetRequiredValue(RunId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentRunsGetAsync( + runId: runId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentRunsListCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentRunsListCommandApiCommand.g.cs new file mode 100644 index 0000000..b8b2d00 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentRunsListCommandApiCommand.g.cs @@ -0,0 +1,123 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentRunsListCommandApiCommand +{ + private static Option Status { get; } = new( + name: @"--status") + { + Description = @"Current status of the run. +- `PENDING` - agent will run soon +- `RUNNING` - agent is currently running +- `COMPLETED` - agent has finished running +- `FAILED` - agent has failed the run +- `STOPPED` - run was stopped by the user +- `TIMED_OUT` - run exceeded maximum time", + }; + + private static Option AgentId { get; } = new( + name: @"--agent-id") + { + Description = @"Only return runs that reference this agent ID.", + }; + + private static Option StartAt { get; } = new( + name: @"--start-at") + { + Description = @"Only return runs created on or after this timestamp (inclusive). ISO 8601 / RFC 3339, e.g. 2026-01-19T00:00:00Z.", + }; + + private static Option EndAt { get; } = new( + name: @"--end-at") + { + Description = @"Only return runs created on or before this timestamp (inclusive). ISO 8601 / RFC 3339, e.g. 2026-01-20T00:00:00Z.", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"Maximum number of results to return.", + }; + + private static Option Cursor { get; } = new( + name: @"--cursor") + { + Description = @"Pagination cursor. Pass the nextCursor from the previous response to fetch the next page. Omit to start from the first page.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.AgentRunsListResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.AgentRunsListResponse value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agent-runs-list", @"List Runs +List runs across your account. Supports filtering by status, by the agent they reference, and by creation time."); + command.Options.Add(Status); + command.Options.Add(AgentId); + command.Options.Add(StartAt); + command.Options.Add(EndAt); + command.Options.Add(Limit); + command.Options.Add(Cursor); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var status = parseResult.GetValue(Status); + var agentId = parseResult.GetValue(AgentId); + var startAt = parseResult.GetValue(StartAt); + var endAt = parseResult.GetValue(EndAt); + var limit = parseResult.GetValue(Limit); + var cursor = parseResult.GetValue(Cursor); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentRunsListAsync( + status: status, + agentId: agentId, + startAt: startAt, + endAt: endAt, + limit: limit, + cursor: cursor, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentRunsMessagesCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentRunsMessagesCommandApiCommand.g.cs new file mode 100644 index 0000000..f418e04 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentRunsMessagesCommandApiCommand.g.cs @@ -0,0 +1,99 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentRunsMessagesCommandApiCommand +{ + private static Argument RunId { get; } = new( + name: @"run-id") + { + Description = @"The run ID.", + }; + + private static Option Since { get; } = new( + name: @"--since") + { + Description = @"The `id` of the last message you've already received. The response will contain messages produced after that one, in chronological order. Omit on the first call. Pass the previous response's `nextSince` value to continue paging or to poll for new messages.", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"Maximum number of messages to return.", + }; + + private static Option All { get; } = CliRuntime.CreateNullableBoolOption( + name: @"--all", + description: @"Return every message after `since` in one response, ignoring `limit`."); + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.AgentRunsMessagesResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.AgentRunsMessagesResponse value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agent-runs-messages", @"List Run Messages +Returns a paginated list of messages produced by a run, in chronological order, with the oldest messages first. + +Messages conform to the [AI SDK UIMessage format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message)."); + command.Arguments.Add(RunId); + command.Options.Add(Since); + command.Options.Add(Limit); + command.Options.Add(All); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var runId = parseResult.GetRequiredValue(RunId); + var since = parseResult.GetValue(Since); + var limit = parseResult.GetValue(Limit); + var all = parseResult.GetValue(All); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentRunsMessagesAsync( + runId: runId, + since: since, + limit: limit, + all: all, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentsCreateCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentsCreateCommandApiCommand.g.cs new file mode 100644 index 0000000..04980f9 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentsCreateCommandApiCommand.g.cs @@ -0,0 +1,118 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentsCreateCommandApiCommand +{ + private static Argument NameOption { get; } = new( + name: @"name") + { + Description = @"Human-readable name for the agent. Used to identify the agent in the dashboard and API responses.", + }; + + private static Option SystemPrompt { get; } = new( + name: @"--system-prompt") + { + Description = @"System prompt that steers the agent's behavior on every run that uses this agent.", + }; + + private static Option ResultSchema { get; } = new( + name: @"--result-schema") + { + Description = @"An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request.", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.Agent value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.Agent value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agents-create", @"Create an Agent +Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run."); + command.Arguments.Add(NameOption); + command.Options.Add(SystemPrompt); + command.Options.Add(ResultSchema); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::Browserbase.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var name = parseResult.GetRequiredValue(NameOption); + var systemPrompt = CliRuntime.WasSpecified(parseResult, SystemPrompt) ? parseResult.GetValue(SystemPrompt) : (__requestBase is { } __SystemPromptBaseValue ? __SystemPromptBaseValue.SystemPrompt : default); + var resultSchema = CliRuntime.WasSpecified(parseResult, ResultSchema) ? parseResult.GetValue(ResultSchema) : (__requestBase is { } __ResultSchemaBaseValue ? __ResultSchemaBaseValue.ResultSchema : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentsCreateAsync( + name: name, + systemPrompt: systemPrompt, + resultSchema: resultSchema, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentsDeleteCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentsDeleteCommandApiCommand.g.cs new file mode 100644 index 0000000..0db5cb7 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentsDeleteCommandApiCommand.g.cs @@ -0,0 +1,38 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentsDeleteCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"The agent ID.", + }; + + public static Command Create() + { + var command = new Command(@"agents-delete", @"Delete an Agent +Delete an agent. Runs that already referenced this agent are unaffected."); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + await client.AgentsDeleteAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + await CliRuntime.WriteSuccessAsync(parseResult, cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentsGetCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentsGetCommandApiCommand.g.cs new file mode 100644 index 0000000..bcc78b1 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentsGetCommandApiCommand.g.cs @@ -0,0 +1,64 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentsGetCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"The agent ID.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.Agent value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.Agent value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agents-get", @"Get an Agent +Retrieve an agent by ID."); + command.Arguments.Add(AgentId); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var agentId = parseResult.GetRequiredValue(AgentId); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentsGetAsync( + agentId: agentId, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentsListCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentsListCommandApiCommand.g.cs new file mode 100644 index 0000000..a0900e9 --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentsListCommandApiCommand.g.cs @@ -0,0 +1,99 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentsListCommandApiCommand +{ + private static Option StartAt { get; } = new( + name: @"--start-at") + { + Description = @"Only return agents created on or after this timestamp (inclusive). ISO 8601 / RFC 3339, e.g. 2026-01-19T00:00:00Z.", + }; + + private static Option EndAt { get; } = new( + name: @"--end-at") + { + Description = @"Only return agents created on or before this timestamp (inclusive). ISO 8601 / RFC 3339, e.g. 2026-01-20T00:00:00Z.", + }; + + private static Option Limit { get; } = new( + name: @"--limit") + { + Description = @"Maximum number of results to return.", + }; + + private static Option Cursor { get; } = new( + name: @"--cursor") + { + Description = @"Pagination cursor. Pass the nextCursor from the previous response to fetch the next page. Omit to start from the first page.", + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.AgentsListResponse value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.AgentsListResponse value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agents-list", @"List Agents +List agents across your account. Supports filtering by creation time."); + command.Options.Add(StartAt); + command.Options.Add(EndAt); + command.Options.Add(Limit); + command.Options.Add(Cursor); + + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var startAt = parseResult.GetValue(StartAt); + var endAt = parseResult.GetValue(EndAt); + var limit = parseResult.GetValue(Limit); + var cursor = parseResult.GetValue(Cursor); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentsListAsync( + startAt: startAt, + endAt: endAt, + limit: limit, + cursor: cursor, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + if (!await CliRuntime.TryWriteOutputDirectoryAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + @"Data", + cancellationToken).ConfigureAwait(false)) + { + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + } + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/AgentsUpdateCommandApiCommand.g.cs b/src/cli/Browserbase.CLI/Commands/AgentsUpdateCommandApiCommand.g.cs new file mode 100644 index 0000000..a9c774b --- /dev/null +++ b/src/cli/Browserbase.CLI/Commands/AgentsUpdateCommandApiCommand.g.cs @@ -0,0 +1,127 @@ +#nullable enable +#pragma warning disable CS0618 + +using System.CommandLine; + +namespace Browserbase.CLI.Commands; + +internal static partial class AgentsUpdateCommandApiCommand +{ + private static Argument AgentId { get; } = new( + name: @"agent-id") + { + Description = @"The agent ID.", + }; + + private static Option NameOption { get; } = new( + name: @"--name") + { + Description = @"Human-readable name for the agent. Used to identify the agent in the dashboard and API responses.", + }; + + private static Option SystemPrompt { get; } = new( + name: @"--system-prompt") + { + Description = @"New system prompt that steers the agent's behavior on every run that uses this agent.", + }; + + private static Option ResultSchema { get; } = new( + name: @"--result-schema") + { + Description = @"An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request.", + }; + private static Option Input { get; } = new(@"--input") + { + Description = "Load request JSON from a file path, '-' for stdin, or an inline JSON object/array string.", + }; + + private static Option RequestJson { get; } = new(@"--request-json") + { + Description = "Request body as JSON.", + Hidden = true, + }; + + private static Option RequestFile { get; } = new(@"--request-file") + { + Description = "Path to a JSON request file, or '-' for stdin.", + Hidden = true, + }; + + private static string FormatResponse(ParseResult parseResult, global::Browserbase.Agent value, global::System.Text.Json.Serialization.JsonSerializerContext context, bool truncateLongStrings) + { + string? text = null; + CustomizeResponseText(parseResult, value, ref text); + if (!string.IsNullOrWhiteSpace(text)) + { + return text; + } + + var hints = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + }; + CustomizeResponseFormatHints(hints); + return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints); + } + + static partial void CustomizeResponseText(ParseResult parseResult, global::Browserbase.Agent value, ref string? text); + static partial void CustomizeResponseFormatHints(Dictionary hints); + + + public static Command Create() + { + var command = new Command(@"agents-update", @"Update an Agent +Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged."); + command.Arguments.Add(AgentId); + command.Options.Add(NameOption); + command.Options.Add(SystemPrompt); + command.Options.Add(ResultSchema); + command.Options.Add(Input); + command.Options.Add(RequestJson); + command.Options.Add(RequestFile); + command.Validators.Add(result => + { + var hasInput = result.GetResult(Input) is not null; + var hasRequestJson = result.GetResult(RequestJson) is not null; + var hasRequestFile = result.GetResult(RequestFile) is not null; + var specifiedCount = (hasInput ? 1 : 0) + (hasRequestJson ? 1 : 0) + (hasRequestFile ? 1 : 0); + if (specifiedCount > 1) + { + result.AddError(@"Specify at most one of --input, --request-json, or --request-file."); + } + }); + + command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) => + await CliRuntime.RunAsync(async () => + { + var __requestBase = await CliRuntime.ReadRequestOrDefaultAsync( + parseResult, + Input, + RequestJson, + RequestFile, + global::Browserbase.SourceGenerationContext.Default, + cancellationToken).ConfigureAwait(false); + var agentId = parseResult.GetRequiredValue(AgentId); + var name = CliRuntime.WasSpecified(parseResult, NameOption) ? parseResult.GetValue(NameOption) : (__requestBase is { } __NameBaseValue ? __NameBaseValue.Name : default); + var systemPrompt = CliRuntime.WasSpecified(parseResult, SystemPrompt) ? parseResult.GetValue(SystemPrompt) : (__requestBase is { } __SystemPromptBaseValue ? __SystemPromptBaseValue.SystemPrompt : default); + var resultSchema = CliRuntime.WasSpecified(parseResult, ResultSchema) ? parseResult.GetValue(ResultSchema) : (__requestBase is { } __ResultSchemaBaseValue ? __ResultSchemaBaseValue.ResultSchema : default); + using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false); + + + var response = await client.AgentsUpdateAsync( + agentId: agentId, + name: name, + systemPrompt: systemPrompt, + resultSchema: resultSchema, + cancellationToken: cancellationToken).ConfigureAwait(false); + + + await CliRuntime.WriteResponseAsync( + parseResult, + response, + global::Browserbase.SourceGenerationContext.Default, + FormatResponse, + cancellationToken).ConfigureAwait(false); + }, cancellationToken).ConfigureAwait(false)); + return command; + } +} \ No newline at end of file diff --git a/src/cli/Browserbase.CLI/Commands/DefaultApiGroupCommand.g.cs b/src/cli/Browserbase.CLI/Commands/DefaultApiGroupCommand.g.cs index 44ea66b..ccdf472 100644 --- a/src/cli/Browserbase.CLI/Commands/DefaultApiGroupCommand.g.cs +++ b/src/cli/Browserbase.CLI/Commands/DefaultApiGroupCommand.g.cs @@ -9,6 +9,15 @@ internal static class DefaultApiGroupCommand public static Command Create() { var command = new Command(@"default", @"default endpoint commands."); + command.Subcommands.Add(AgentRunsCreateCommandApiCommand.Create()); + command.Subcommands.Add(AgentRunsGetCommandApiCommand.Create()); + command.Subcommands.Add(AgentRunsListCommandApiCommand.Create()); + command.Subcommands.Add(AgentRunsMessagesCommandApiCommand.Create()); + command.Subcommands.Add(AgentsCreateCommandApiCommand.Create()); + command.Subcommands.Add(AgentsDeleteCommandApiCommand.Create()); + command.Subcommands.Add(AgentsGetCommandApiCommand.Create()); + command.Subcommands.Add(AgentsListCommandApiCommand.Create()); + command.Subcommands.Add(AgentsUpdateCommandApiCommand.Create()); command.Subcommands.Add(CertificatesDeleteCommandApiCommand.Create()); command.Subcommands.Add(CertificatesGetCommandApiCommand.Create()); command.Subcommands.Add(CertificatesListCommandApiCommand.Create()); diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsCreate.g.cs new file mode 100644 index 0000000..8dceb30 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsCreate.g.cs @@ -0,0 +1,482 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentRunsCreateSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentRunsCreateSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentRunsCreateSecurityRequirement0, + }; + partial void PrepareAgentRunsCreateArguments( + global::System.Net.Http.HttpClient httpClient, + global::Browserbase.AgentRunsCreateRequest request); + partial void PrepareAgentRunsCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Browserbase.AgentRunsCreateRequest request); + partial void ProcessAgentRunsCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentRunsCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Run an Agent
+ /// Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentRunsCreateAsync( + + global::Browserbase.AgentRunsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentRunsCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run an Agent
+ /// Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentRunsCreateAsResponseAsync( + + global::Browserbase.AgentRunsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAgentRunsCreateArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentRunsCreateSecurityRequirements, + operationName: "AgentRunsCreateAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: "/v1/agents/runs", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentRunsCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsCreate", + methodName: "AgentRunsCreateAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsCreate", + methodName: "AgentRunsCreateAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsCreate", + methodName: "AgentRunsCreateAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentRunsCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsCreate", + methodName: "AgentRunsCreateAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsCreate", + methodName: "AgentRunsCreateAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentRunsCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.AgentRun.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.AgentRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Run an Agent
+ /// Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created. + ///
+ /// + /// Optionally run a specific [custom agent](/reference/api/create-an-agent) you've created by ID. The run will use the agent's `systemPrompt` and `resultSchema` unless overridden. + /// + /// + /// A natural language description of the task the agent should accomplish. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, the agent will aim to return a `result` that conforms to this schema when the run completes. Overrides the referenced agent's default `resultSchema` for this run only. + /// + /// + /// Browser configuration for the agent's session. When omitted, runner defaults apply. + /// + /// + /// Optional named variables the agent can reference as placeholders, i.e. `%variable%`. Each entry pairs a `value` the placeholder resolves to with an optional `description` that hints to the agent when it should be used. Values are not persisted. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentRunsCreateAsync( + string task, + string? agentId = default, + object? resultSchema = default, + global::Browserbase.AgentRunsCreateRequestBrowserSettings? browserSettings = default, + global::System.Collections.Generic.Dictionary? variables = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Browserbase.AgentRunsCreateRequest + { + AgentId = agentId, + Task = task, + ResultSchema = resultSchema, + BrowserSettings = browserSettings, + Variables = variables, + }; + + return await AgentRunsCreateAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsGet.g.cs new file mode 100644 index 0000000..807b7f0 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsGet.g.cs @@ -0,0 +1,426 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentRunsGetSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentRunsGetSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentRunsGetSecurityRequirement0, + }; + partial void PrepareAgentRunsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string runId); + partial void PrepareAgentRunsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string runId); + partial void ProcessAgentRunsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentRunsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get a Run
+ /// Retrieve the current status and details of a run, including its result and associated session information. To fetch the run's messages, use [List Run Messages](/reference/api/list-run-messages). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentRunsGetAsync( + string runId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentRunsGetAsResponseAsync( + runId: runId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get a Run
+ /// Retrieve the current status and details of a run, including its result and associated session information. To fetch the run's messages, use [List Run Messages](/reference/api/list-run-messages). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentRunsGetAsResponseAsync( + string runId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAgentRunsGetArguments( + httpClient: HttpClient, + runId: ref runId); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentRunsGetSecurityRequirements, + operationName: "AgentRunsGetAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/agents/runs/{runId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentRunsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + runId: runId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsGet", + methodName: "AgentRunsGetAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsGet", + methodName: "AgentRunsGetAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsGet", + methodName: "AgentRunsGetAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentRunsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsGet", + methodName: "AgentRunsGetAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsGet", + methodName: "AgentRunsGetAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentRunsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.AgentRun.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.AgentRun.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsList.g.cs new file mode 100644 index 0000000..414bec2 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsList.g.cs @@ -0,0 +1,483 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentRunsListSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentRunsListSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentRunsListSecurityRequirement0, + }; + partial void PrepareAgentRunsListArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::Browserbase.AgentRunsListStatus? status, + ref string? agentId, + ref global::System.DateTime? startAt, + ref global::System.DateTime? endAt, + ref int? limit, + ref string? cursor); + partial void PrepareAgentRunsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Browserbase.AgentRunsListStatus? status, + string? agentId, + global::System.DateTime? startAt, + global::System.DateTime? endAt, + int? limit, + string? cursor); + partial void ProcessAgentRunsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentRunsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Runs
+ /// List runs across your account. Supports filtering by status, by the agent they reference, and by creation time. + ///
+ /// + /// + /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentRunsListAsync( + global::Browserbase.AgentRunsListStatus? status = default, + string? agentId = default, + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentRunsListAsResponseAsync( + status: status, + agentId: agentId, + startAt: startAt, + endAt: endAt, + limit: limit, + cursor: cursor, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Runs
+ /// List runs across your account. Supports filtering by status, by the agent they reference, and by creation time. + ///
+ /// + /// + /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentRunsListAsResponseAsync( + global::Browserbase.AgentRunsListStatus? status = default, + string? agentId = default, + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAgentRunsListArguments( + httpClient: HttpClient, + status: ref status, + agentId: ref agentId, + startAt: ref startAt, + endAt: ref endAt, + limit: ref limit, + cursor: ref cursor); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentRunsListSecurityRequirements, + operationName: "AgentRunsListAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: "/v1/agents/runs", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("status", status?.ToValueString()) + .AddOptionalParameter("agentId", agentId) + .AddOptionalParameter("startAt", startAt?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("endAt", endAt?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("cursor", cursor) + ; + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentRunsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + status: status, + agentId: agentId, + startAt: startAt, + endAt: endAt, + limit: limit, + cursor: cursor); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsList", + methodName: "AgentRunsListAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsList", + methodName: "AgentRunsListAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsList", + methodName: "AgentRunsListAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentRunsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsList", + methodName: "AgentRunsListAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsList", + methodName: "AgentRunsListAsync", + pathTemplate: "\"/v1/agents/runs\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentRunsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.AgentRunsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.AgentRunsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsMessages.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsMessages.g.cs new file mode 100644 index 0000000..e61ff17 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentRunsMessages.g.cs @@ -0,0 +1,468 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentRunsMessagesSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentRunsMessagesSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentRunsMessagesSecurityRequirement0, + }; + partial void PrepareAgentRunsMessagesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string? since, + ref int? limit, + ref bool? all, + ref global::System.Guid runId); + partial void PrepareAgentRunsMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string? since, + int? limit, + bool? all, + global::System.Guid runId); + partial void ProcessAgentRunsMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentRunsMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Run Messages
+ /// Returns a paginated list of messages produced by a run, in chronological order, with the oldest messages first.
+ /// Messages conform to the [AI SDK UIMessage format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message). + ///
+ /// + /// + /// Default Value: 20 + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentRunsMessagesAsync( + global::System.Guid runId, + string? since = default, + int? limit = default, + bool? all = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentRunsMessagesAsResponseAsync( + runId: runId, + since: since, + limit: limit, + all: all, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Run Messages
+ /// Returns a paginated list of messages produced by a run, in chronological order, with the oldest messages first.
+ /// Messages conform to the [AI SDK UIMessage format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message). + ///
+ /// + /// + /// Default Value: 20 + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentRunsMessagesAsResponseAsync( + global::System.Guid runId, + string? since = default, + int? limit = default, + bool? all = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAgentRunsMessagesArguments( + httpClient: HttpClient, + since: ref since, + limit: ref limit, + all: ref all, + runId: ref runId); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentRunsMessagesSecurityRequirements, + operationName: "AgentRunsMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/agents/runs/{runId}/messages", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("since", since) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("all", all?.ToString().ToLowerInvariant()) + ; + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentRunsMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + since: since, + limit: limit, + all: all, + runId: runId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsMessages", + methodName: "AgentRunsMessagesAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}/messages\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsMessages", + methodName: "AgentRunsMessagesAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}/messages\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsMessages", + methodName: "AgentRunsMessagesAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}/messages\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentRunsMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsMessages", + methodName: "AgentRunsMessagesAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}/messages\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentRunsMessages", + methodName: "AgentRunsMessagesAsync", + pathTemplate: "$\"/v1/agents/runs/{runId}/messages\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentRunsMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.AgentRunsMessagesResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.AgentRunsMessagesResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsCreate.g.cs new file mode 100644 index 0000000..fd2ac52 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsCreate.g.cs @@ -0,0 +1,472 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentsCreateSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentsCreateSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentsCreateSecurityRequirement0, + }; + partial void PrepareAgentsCreateArguments( + global::System.Net.Http.HttpClient httpClient, + global::Browserbase.AgentsCreateRequest request); + partial void PrepareAgentsCreateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::Browserbase.AgentsCreateRequest request); + partial void ProcessAgentsCreateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentsCreateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create an Agent
+ /// Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsCreateAsync( + + global::Browserbase.AgentsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsCreateAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create an Agent
+ /// Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsCreateAsResponseAsync( + + global::Browserbase.AgentsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAgentsCreateArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentsCreateSecurityRequirements, + operationName: "AgentsCreateAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: "/v1/agents", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentsCreateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsCreate", + methodName: "AgentsCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsCreate", + methodName: "AgentsCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsCreate", + methodName: "AgentsCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentsCreateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsCreate", + methodName: "AgentsCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsCreate", + methodName: "AgentsCreateAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentsCreateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.Agent.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create an Agent
+ /// Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run. + ///
+ /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// System prompt that steers the agent's behavior on every run that uses this agent. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsCreateAsync( + string name, + string? systemPrompt = default, + object? resultSchema = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Browserbase.AgentsCreateRequest + { + Name = name, + SystemPrompt = systemPrompt, + ResultSchema = resultSchema, + }; + + return await AgentsCreateAsync( + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsDelete.g.cs new file mode 100644 index 0000000..2357b41 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsDelete.g.cs @@ -0,0 +1,403 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentsDeleteSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentsDeleteSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentsDeleteSecurityRequirement0, + }; + partial void PrepareAgentsDeleteArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareAgentsDeleteRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessAgentsDeleteResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + /// + /// Delete an Agent
+ /// Delete an agent. Runs that already referenced this agent are unaffected. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsDeleteAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await AgentsDeleteAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete an Agent
+ /// Delete an agent. Runs that already referenced this agent are unaffected. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsDeleteAsResponseAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAgentsDeleteArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentsDeleteSecurityRequirements, + operationName: "AgentsDeleteAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Delete, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentsDeleteRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsDelete", + methodName: "AgentsDeleteAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsDelete", + methodName: "AgentsDeleteAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsDelete", + methodName: "AgentsDeleteAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentsDeleteResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsDelete", + methodName: "AgentsDeleteAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsDelete", + methodName: "AgentsDeleteAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "DELETE", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsGet.g.cs new file mode 100644 index 0000000..34f21c0 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsGet.g.cs @@ -0,0 +1,426 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentsGetSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentsGetSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentsGetSecurityRequirement0, + }; + partial void PrepareAgentsGetArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId); + partial void PrepareAgentsGetRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId); + partial void ProcessAgentsGetResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentsGetResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Get an Agent
+ /// Retrieve an agent by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsGetAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsGetAsResponseAsync( + agentId: agentId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get an Agent
+ /// Retrieve an agent by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsGetAsResponseAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAgentsGetArguments( + httpClient: HttpClient, + agentId: ref agentId); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentsGetSecurityRequirements, + operationName: "AgentsGetAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentsGetRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsGet", + methodName: "AgentsGetAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsGet", + methodName: "AgentsGetAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsGet", + methodName: "AgentsGetAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentsGetResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsGet", + methodName: "AgentsGetAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsGet", + methodName: "AgentsGetAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentsGetResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.Agent.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsList.g.cs new file mode 100644 index 0000000..0bdaa1f --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsList.g.cs @@ -0,0 +1,463 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentsListSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentsListSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentsListSecurityRequirement0, + }; + partial void PrepareAgentsListArguments( + global::System.Net.Http.HttpClient httpClient, + ref global::System.DateTime? startAt, + ref global::System.DateTime? endAt, + ref int? limit, + ref string? cursor); + partial void PrepareAgentsListRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::System.DateTime? startAt, + global::System.DateTime? endAt, + int? limit, + string? cursor); + partial void ProcessAgentsListResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentsListResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// List Agents
+ /// List agents across your account. Supports filtering by creation time. + ///
+ /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsListAsync( + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsListAsResponseAsync( + startAt: startAt, + endAt: endAt, + limit: limit, + cursor: cursor, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Agents
+ /// List agents across your account. Supports filtering by creation time. + ///
+ /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsListAsResponseAsync( + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareAgentsListArguments( + httpClient: HttpClient, + startAt: ref startAt, + endAt: ref endAt, + limit: ref limit, + cursor: ref cursor); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentsListSecurityRequirements, + operationName: "AgentsListAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: "/v1/agents", + baseUri: HttpClient.BaseAddress); + __pathBuilder + .AddOptionalParameter("startAt", startAt?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("endAt", endAt?.ToString("yyyy-MM-ddTHH:mm:ssZ")) + .AddOptionalParameter("limit", limit?.ToString()) + .AddOptionalParameter("cursor", cursor) + ; + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentsListRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + startAt: startAt, + endAt: endAt, + limit: limit, + cursor: cursor); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsList", + methodName: "AgentsListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsList", + methodName: "AgentsListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsList", + methodName: "AgentsListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentsListResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsList", + methodName: "AgentsListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsList", + methodName: "AgentsListAsync", + pathTemplate: "\"/v1/agents\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentsListResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.AgentsListResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.AgentsListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsUpdate.g.cs b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsUpdate.g.cs new file mode 100644 index 0000000..66198f7 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.BrowserbaseClient.AgentsUpdate.g.cs @@ -0,0 +1,484 @@ + +#nullable enable + +namespace Browserbase +{ + public partial class BrowserbaseClient + { + + + private static readonly global::Browserbase.EndPointSecurityRequirement s_AgentsUpdateSecurityRequirement0 = + new global::Browserbase.EndPointSecurityRequirement + { + Authorizations = new global::Browserbase.EndPointAuthorizationRequirement[] + { new global::Browserbase.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "HttpBearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::Browserbase.EndPointSecurityRequirement[] s_AgentsUpdateSecurityRequirements = + new global::Browserbase.EndPointSecurityRequirement[] + { s_AgentsUpdateSecurityRequirement0, + }; + partial void PrepareAgentsUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string agentId, + global::Browserbase.AgentsUpdateRequest request); + partial void PrepareAgentsUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string agentId, + global::Browserbase.AgentsUpdateRequest request); + partial void ProcessAgentsUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessAgentsUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update an Agent
+ /// Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsUpdateAsync( + string agentId, + + global::Browserbase.AgentsUpdateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AgentsUpdateAsResponseAsync( + agentId: agentId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update an Agent
+ /// Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> AgentsUpdateAsResponseAsync( + string agentId, + + global::Browserbase.AgentsUpdateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareAgentsUpdateArguments( + httpClient: HttpClient, + agentId: ref agentId, + request: request); + + + var __authorizations = global::Browserbase.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_AgentsUpdateSecurityRequirements, + operationName: "AgentsUpdateAsync"); + + using var __timeoutCancellationTokenSource = global::Browserbase.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Browserbase.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Browserbase.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Browserbase.PathBuilder( + path: $"/v1/agents/{agentId}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::Browserbase.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::Browserbase.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareAgentsUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + agentId: agentId!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsUpdate", + methodName: "AgentsUpdateAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsUpdate", + methodName: "AgentsUpdateAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Browserbase.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Browserbase.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsUpdate", + methodName: "AgentsUpdateAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Browserbase.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessAgentsUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsUpdate", + methodName: "AgentsUpdateAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Browserbase.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Browserbase.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "AgentsUpdate", + methodName: "AgentsUpdateAsync", + pathTemplate: "$\"/v1/agents/{agentId}\"", + httpMethod: "PATCH", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessAgentsUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Browserbase.Agent.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::Browserbase.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::Browserbase.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Browserbase.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Browserbase.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Update an Agent
+ /// Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged. + ///
+ /// + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// New system prompt that steers the agent's behavior on every run that uses this agent. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task AgentsUpdateAsync( + string agentId, + string? name = default, + string? systemPrompt = default, + object? resultSchema = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Browserbase.AgentsUpdateRequest + { + Name = name, + SystemPrompt = systemPrompt, + ResultSchema = resultSchema, + }; + + return await AgentsUpdateAsync( + agentId: agentId, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsCreate.g.cs new file mode 100644 index 0000000..81521fe --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsCreate.g.cs @@ -0,0 +1,64 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// Run an Agent
+ /// Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentRunsCreateAsync( + + global::Browserbase.AgentRunsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run an Agent
+ /// Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentRunsCreateAsResponseAsync( + + global::Browserbase.AgentRunsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run an Agent
+ /// Run a browser agent to complete the `task` by using web search and browser tooling. Optionally pass `agentId` to run a [custom agent](/reference/api/create-an-agent) you've created. + ///
+ /// + /// Optionally run a specific [custom agent](/reference/api/create-an-agent) you've created by ID. The run will use the agent's `systemPrompt` and `resultSchema` unless overridden. + /// + /// + /// A natural language description of the task the agent should accomplish. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, the agent will aim to return a `result` that conforms to this schema when the run completes. Overrides the referenced agent's default `resultSchema` for this run only. + /// + /// + /// Browser configuration for the agent's session. When omitted, runner defaults apply. + /// + /// + /// Optional named variables the agent can reference as placeholders, i.e. `%variable%`. Each entry pairs a `value` the placeholder resolves to with an optional `description` that hints to the agent when it should be used. Values are not persisted. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentRunsCreateAsync( + string task, + string? agentId = default, + object? resultSchema = default, + global::Browserbase.AgentRunsCreateRequestBrowserSettings? browserSettings = default, + global::System.Collections.Generic.Dictionary? variables = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsGet.g.cs new file mode 100644 index 0000000..32153ac --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsGet.g.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// Get a Run
+ /// Retrieve the current status and details of a run, including its result and associated session information. To fetch the run's messages, use [List Run Messages](/reference/api/list-run-messages). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentRunsGetAsync( + string runId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get a Run
+ /// Retrieve the current status and details of a run, including its result and associated session information. To fetch the run's messages, use [List Run Messages](/reference/api/list-run-messages). + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentRunsGetAsResponseAsync( + string runId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsList.g.cs new file mode 100644 index 0000000..c28d397 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsList.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// List Runs
+ /// List runs across your account. Supports filtering by status, by the agent they reference, and by creation time. + ///
+ /// + /// + /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentRunsListAsync( + global::Browserbase.AgentRunsListStatus? status = default, + string? agentId = default, + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Runs
+ /// List runs across your account. Supports filtering by status, by the agent they reference, and by creation time. + ///
+ /// + /// + /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentRunsListAsResponseAsync( + global::Browserbase.AgentRunsListStatus? status = default, + string? agentId = default, + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsMessages.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsMessages.g.cs new file mode 100644 index 0000000..e6cefdc --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentRunsMessages.g.cs @@ -0,0 +1,54 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// List Run Messages
+ /// Returns a paginated list of messages produced by a run, in chronological order, with the oldest messages first.
+ /// Messages conform to the [AI SDK UIMessage format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message). + ///
+ /// + /// + /// Default Value: 20 + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentRunsMessagesAsync( + global::System.Guid runId, + string? since = default, + int? limit = default, + bool? all = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Run Messages
+ /// Returns a paginated list of messages produced by a run, in chronological order, with the oldest messages first.
+ /// Messages conform to the [AI SDK UIMessage format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message). + ///
+ /// + /// + /// Default Value: 20 + /// + /// + /// Default Value: false + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentRunsMessagesAsResponseAsync( + global::System.Guid runId, + string? since = default, + int? limit = default, + bool? all = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsCreate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsCreate.g.cs new file mode 100644 index 0000000..5b9d80d --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsCreate.g.cs @@ -0,0 +1,56 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// Create an Agent
+ /// Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsCreateAsync( + + global::Browserbase.AgentsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an Agent
+ /// Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsCreateAsResponseAsync( + + global::Browserbase.AgentsCreateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create an Agent
+ /// Create a reusable agent. An agent defines a `systemPrompt` and `resultSchema` that guide its behavior for every run. Only `name` is required; an agent created with no `systemPrompt` behaves like an unconfigured run. + ///
+ /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// System prompt that steers the agent's behavior on every run that uses this agent. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsCreateAsync( + string name, + string? systemPrompt = default, + object? resultSchema = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsDelete.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsDelete.g.cs new file mode 100644 index 0000000..a5cbc85 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsDelete.g.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// Delete an Agent
+ /// Delete an agent. Runs that already referenced this agent are unaffected. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsDeleteAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an Agent
+ /// Delete an agent. Runs that already referenced this agent are unaffected. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsDeleteAsResponseAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsGet.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsGet.g.cs new file mode 100644 index 0000000..dd67889 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsGet.g.cs @@ -0,0 +1,32 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// Get an Agent
+ /// Retrieve an agent by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsGetAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get an Agent
+ /// Retrieve an agent by ID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsGetAsResponseAsync( + string agentId, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsList.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsList.g.cs new file mode 100644 index 0000000..aa64036 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsList.g.cs @@ -0,0 +1,48 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// List Agents
+ /// List agents across your account. Supports filtering by creation time. + ///
+ /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsListAsync( + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Agents
+ /// List agents across your account. Supports filtering by creation time. + ///
+ /// + /// + /// + /// Default Value: 20 + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsListAsResponseAsync( + global::System.DateTime? startAt = default, + global::System.DateTime? endAt = default, + int? limit = default, + string? cursor = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsUpdate.g.cs b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsUpdate.g.cs new file mode 100644 index 0000000..f6e3997 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.IBrowserbaseClient.AgentsUpdate.g.cs @@ -0,0 +1,62 @@ +#nullable enable + +namespace Browserbase +{ + public partial interface IBrowserbaseClient + { + /// + /// Update an Agent
+ /// Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsUpdateAsync( + string agentId, + + global::Browserbase.AgentsUpdateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an Agent
+ /// Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AgentsUpdateAsResponseAsync( + string agentId, + + global::Browserbase.AgentsUpdateRequest request, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an Agent
+ /// Update an existing agent. Only the fields provided in the body are modified; omitted fields are left unchanged. + ///
+ /// + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// New system prompt that steers the agent's behavior on every run that uses this agent. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task AgentsUpdateAsync( + string agentId, + string? name = default, + string? systemPrompt = default, + object? resultSchema = default, + global::Browserbase.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatus.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatus.g.cs new file mode 100644 index 0000000..9414047 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public sealed class AgentRunStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Browserbase.AgentRunStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Browserbase.AgentRunStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Browserbase.AgentRunStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Browserbase.AgentRunStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.AgentRunStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Browserbase.AgentRunStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatusNullable.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatusNullable.g.cs new file mode 100644 index 0000000..18a0889 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public sealed class AgentRunStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Browserbase.AgentRunStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Browserbase.AgentRunStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Browserbase.AgentRunStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Browserbase.AgentRunStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.AgentRunStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Browserbase.AgentRunStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatus.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatus.g.cs new file mode 100644 index 0000000..5f2d058 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatus.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public sealed class AgentRunsListStatusJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Browserbase.AgentRunsListStatus Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Browserbase.AgentRunsListStatusExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Browserbase.AgentRunsListStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Browserbase.AgentRunsListStatus); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.AgentRunsListStatus value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Browserbase.AgentRunsListStatusExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatusNullable.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatusNullable.g.cs new file mode 100644 index 0000000..4efe808 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsListStatusNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public sealed class AgentRunsListStatusNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Browserbase.AgentRunsListStatus? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Browserbase.AgentRunsListStatusExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Browserbase.AgentRunsListStatus)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Browserbase.AgentRunsListStatus?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.AgentRunsListStatus? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Browserbase.AgentRunsListStatusExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRole.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRole.g.cs new file mode 100644 index 0000000..198b873 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRole.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public sealed class AgentRunsMessagesResponseDataItemMessageRoleJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Browserbase.AgentRunsMessagesResponseDataItemMessageRoleExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::Browserbase.AgentRunsMessagesResponseDataItemMessageRoleExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleNullable.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleNullable.g.cs new file mode 100644 index 0000000..826f29c --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public sealed class AgentRunsMessagesResponseDataItemMessageRoleNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole? Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case global::System.Text.Json.JsonTokenType.String: + { + var stringValue = reader.GetString(); + if (stringValue != null) + { + return global::Browserbase.AgentRunsMessagesResponseDataItemMessageRoleExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole? value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + if (value == null) + { + writer.WriteNullValue(); + } + else + { + writer.WriteStringValue(global::Browserbase.AgentRunsMessagesResponseDataItemMessageRoleExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonConverters.OneOf2.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.OneOf2.g.cs new file mode 100644 index 0000000..eb5b53b --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.JsonConverters.OneOf2.g.cs @@ -0,0 +1,161 @@ +#nullable enable + +namespace Browserbase.JsonConverters +{ + /// + public class OneOfJsonConverter : global::System.Text.Json.Serialization.JsonConverter> + { + /// + public override global::Browserbase.OneOf Read( + ref global::System.Text.Json.Utf8JsonReader reader, + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + + using var __jsonDocument = global::System.Text.Json.JsonDocument.ParseValue(ref reader); + var __rawJson = __jsonDocument.RootElement.GetRawText(); + var __jsonProps = new global::System.Collections.Generic.HashSet(); + if (__jsonDocument.RootElement.ValueKind == global::System.Text.Json.JsonValueKind.Object) + { + foreach (var __jsonProp in __jsonDocument.RootElement.EnumerateObject()) + { + __jsonProps.Add(__jsonProp.Name); + } + } + + var __score0 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T1), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score0++; + } + } + } + var __score1 = 0; + { + var __ti = typeInfoResolver.GetTypeInfo(typeof(T2), options); + if (__ti != null && __ti.Kind == global::System.Text.Json.Serialization.Metadata.JsonTypeInfoKind.Object) + { + foreach (var __prop in __ti.Properties) + { + if (__jsonProps.Contains(__prop.Name)) __score1++; + } + } + } + var __bestScore = 0; + var __bestIndex = -1; + if (__score0 > __bestScore) { __bestScore = __score0; __bestIndex = 0; } + if (__score1 > __bestScore) { __bestScore = __score1; __bestIndex = 1; } + + T1? value1 = default; + T2? value2 = default; + if (__bestIndex >= 0) + { + if (__bestIndex == 0) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + else if (__bestIndex == 1) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + } + + if (value1 == null && value2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + value1 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + if (value1 == null && value2 == null) + { + try + { + + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + value2 = global::System.Text.Json.JsonSerializer.Deserialize(__rawJson, typeInfo); + } + catch (global::System.Text.Json.JsonException) + { + } + catch (global::System.InvalidOperationException) + { + } + } + + var __value = new global::Browserbase.OneOf( + value1, + + value2 + ); + + return __value; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::Browserbase.OneOf value, + global::System.Text.Json.JsonSerializerOptions options) + { + options = options ?? throw new global::System.ArgumentNullException(nameof(options)); + var typeInfoResolver = options.TypeInfoResolver ?? throw new global::System.InvalidOperationException("TypeInfoResolver is not set."); + + if (value.IsValue1) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T1).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value1!, typeInfo); + } + else if (value.IsValue2) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(T2), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(T2).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.Value2!, typeInfo); + } + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContext.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContext.g.cs index 3c54418..3c16487 100644 --- a/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContext.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContext.g.cs @@ -13,6 +13,10 @@ namespace Browserbase DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, Converters = new global::System.Type[] { + typeof(global::Browserbase.JsonConverters.AgentRunStatusJsonConverter), + + typeof(global::Browserbase.JsonConverters.AgentRunStatusNullableJsonConverter), + typeof(global::Browserbase.JsonConverters.BrowserbaseProxyConfigTypeJsonConverter), typeof(global::Browserbase.JsonConverters.BrowserbaseProxyConfigTypeNullableJsonConverter), @@ -81,10 +85,18 @@ namespace Browserbase typeof(global::Browserbase.JsonConverters.SessionsUpdateRequestStatusNullableJsonConverter), + typeof(global::Browserbase.JsonConverters.AgentRunsListStatusJsonConverter), + + typeof(global::Browserbase.JsonConverters.AgentRunsListStatusNullableJsonConverter), + typeof(global::Browserbase.JsonConverters.SessionsListStatusJsonConverter), typeof(global::Browserbase.JsonConverters.SessionsListStatusNullableJsonConverter), + typeof(global::Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleJsonConverter), + + typeof(global::Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleNullableJsonConverter), + typeof(global::Browserbase.JsonConverters.InvocationsGetResponseCauseCodeJsonConverter), typeof(global::Browserbase.JsonConverters.InvocationsGetResponseCauseCodeNullableJsonConverter), @@ -103,6 +115,8 @@ namespace Browserbase typeof(global::Browserbase.JsonConverters.AnyOfJsonConverter), + typeof(global::Browserbase.JsonConverters.OneOfJsonConverter>), + typeof(global::Browserbase.JsonConverters.AnyOfJsonConverter), typeof(global::Browserbase.JsonConverters.AllOfJsonConverter), @@ -114,12 +128,17 @@ namespace Browserbase typeof(global::Browserbase.JsonConverters.UnixTimestampJsonConverter), })] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.JsonSerializerContextTypes))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.Agent))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRun))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunStatus), TypeInfoPropertyName = "AgentRunStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunCause))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.BrowserbaseProxyConfig))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.BrowserbaseProxyConfigType), TypeInfoPropertyName = "BrowserbaseProxyConfigType2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.BrowserbaseProxyConfigGeolocation))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.Certificate))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.Context))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.Extension))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.ExternalProxyConfig))] @@ -138,7 +157,6 @@ namespace Browserbase [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.FunctionBuildCauseCode), TypeInfoPropertyName = "FunctionBuildCauseCode2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.FunctionBuildLog))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.Invocation))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.InvocationStatus), TypeInfoPropertyName = "InvocationStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AnyOf, object>), TypeInfoPropertyName = "AnyOfStringDoubleBooleanIListObjectObject2")] @@ -162,6 +180,13 @@ namespace Browserbase [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionLogRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionLogResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionRecording))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentsCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsCreateRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsCreateRequestBrowserSettings))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsCreateRequestVariables2))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentsUpdateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.CertificatesUploadRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.ContextsCreateRequest))] @@ -196,7 +221,20 @@ namespace Browserbase [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionsUpdateRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionsUpdateRequestStatus), TypeInfoPropertyName = "SessionsUpdateRequestStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionsUploadFileRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsListStatus), TypeInfoPropertyName = "AgentRunsListStatus2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.SessionsListStatus), TypeInfoPropertyName = "SessionsListStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentsListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsListResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsMessagesResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsMessagesResponseDataItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole), TypeInfoPropertyName = "AgentRunsMessagesResponseDataItemMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.OneOf>), TypeInfoPropertyName = "OneOfStringIListAgentRunsMessagesResponseDataItemMessageContentVariant2Item2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.ContextsCreateResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte))] @@ -252,6 +290,11 @@ namespace Browserbase [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.AnyOf>, bool?>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Browserbase.OneOf>))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContextTypes.g.cs b/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContextTypes.g.cs index 1e7b1f6..4e47707 100644 --- a/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContextTypes.g.cs +++ b/src/libs/Browserbase/Generated/Browserbase.JsonSerializerContextTypes.g.cs @@ -28,519 +28,615 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Browserbase.BrowserbaseProxyConfig? Type0 { get; set; } + public global::Browserbase.Agent? Type0 { get; set; } /// /// /// - public global::Browserbase.BrowserbaseProxyConfigType? Type1 { get; set; } + public string? Type1 { get; set; } /// /// /// - public global::Browserbase.BrowserbaseProxyConfigGeolocation? Type2 { get; set; } + public object? Type2 { get; set; } /// /// /// - public string? Type3 { get; set; } + public global::System.DateTime? Type3 { get; set; } /// /// /// - public global::Browserbase.Certificate? Type4 { get; set; } + public global::Browserbase.AgentRun? Type4 { get; set; } /// /// /// - public global::System.DateTime? Type5 { get; set; } + public global::Browserbase.AgentRunStatus? Type5 { get; set; } /// /// /// - public global::Browserbase.Context? Type6 { get; set; } + public global::Browserbase.AgentRunCause? Type6 { get; set; } /// /// /// - public global::Browserbase.Extension? Type7 { get; set; } + public global::Browserbase.BrowserbaseProxyConfig? Type7 { get; set; } /// /// /// - public global::Browserbase.ExternalProxyConfig? Type8 { get; set; } + public global::Browserbase.BrowserbaseProxyConfigType? Type8 { get; set; } /// /// /// - public global::Browserbase.ExternalProxyConfigType? Type9 { get; set; } + public global::Browserbase.BrowserbaseProxyConfigGeolocation? Type9 { get; set; } /// /// /// - public global::Browserbase.Function? Type10 { get; set; } + public global::Browserbase.Certificate? Type10 { get; set; } /// /// /// - public global::System.Guid? Type11 { get; set; } + public global::Browserbase.Context? Type11 { get; set; } /// /// /// - public global::Browserbase.FunctionBuild? Type12 { get; set; } + public global::Browserbase.Extension? Type12 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildRequest? Type13 { get; set; } + public global::Browserbase.ExternalProxyConfig? Type13 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type14 { get; set; } + public global::Browserbase.ExternalProxyConfigType? Type14 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildStatus? Type15 { get; set; } + public global::Browserbase.Function? Type15 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type16 { get; set; } + public global::System.Guid? Type16 { get; set; } /// /// /// - public global::Browserbase.AllOf? Type17 { get; set; } + public global::Browserbase.FunctionBuild? Type17 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildBuiltFunction? Type18 { get; set; } + public global::Browserbase.FunctionBuildRequest? Type18 { get; set; } /// /// /// - public global::Browserbase.FunctionVersion? Type19 { get; set; } + public global::System.Collections.Generic.IList? Type19 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildCause? Type20 { get; set; } + public global::Browserbase.FunctionBuildStatus? Type20 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildCauseCode? Type21 { get; set; } + public global::System.Collections.Generic.IList>? Type21 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildLog? Type22 { get; set; } + public global::Browserbase.AllOf? Type22 { get; set; } /// /// /// - public double? Type23 { get; set; } + public global::Browserbase.FunctionBuildBuiltFunction? Type23 { get; set; } /// /// /// - public object? Type24 { get; set; } + public global::Browserbase.FunctionVersion? Type24 { get; set; } /// /// /// - public global::Browserbase.Invocation? Type25 { get; set; } + public global::Browserbase.FunctionBuildCause? Type25 { get; set; } /// /// /// - public global::Browserbase.InvocationStatus? Type26 { get; set; } + public global::Browserbase.FunctionBuildCauseCode? Type26 { get; set; } /// /// /// - public global::Browserbase.AnyOf, object>? Type27 { get; set; } + public global::Browserbase.FunctionBuildLog? Type27 { get; set; } /// /// /// - public bool? Type28 { get; set; } + public double? Type28 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type29 { get; set; } + public global::Browserbase.Invocation? Type29 { get; set; } /// /// /// - public global::Browserbase.InvocationLog? Type30 { get; set; } + public global::Browserbase.InvocationStatus? Type30 { get; set; } /// /// /// - public global::Browserbase.NoneProxyConfig? Type31 { get; set; } + public global::Browserbase.AnyOf, object>? Type31 { get; set; } /// /// /// - public global::Browserbase.NoneProxyConfigType? Type32 { get; set; } + public bool? Type32 { get; set; } /// /// /// - public global::Browserbase.Project? Type33 { get; set; } + public global::System.Collections.Generic.IList? Type33 { get; set; } /// /// /// - public int? Type34 { get; set; } + public global::Browserbase.InvocationLog? Type34 { get; set; } /// /// /// - public global::Browserbase.ProjectUsage? Type35 { get; set; } + public global::Browserbase.NoneProxyConfig? Type35 { get; set; } /// /// /// - public long? Type36 { get; set; } + public global::Browserbase.NoneProxyConfigType? Type36 { get; set; } /// /// /// - public global::Browserbase.ReplayPage? Type37 { get; set; } + public global::Browserbase.Project? Type37 { get; set; } /// /// /// - public global::Browserbase.Session? Type38 { get; set; } + public int? Type38 { get; set; } /// /// /// - public global::Browserbase.SessionStatus? Type39 { get; set; } + public global::Browserbase.ProjectUsage? Type39 { get; set; } /// /// /// - public global::Browserbase.SessionRegion? Type40 { get; set; } + public long? Type40 { get; set; } /// /// /// - public global::Browserbase.SessionLiveUrls? Type41 { get; set; } + public global::Browserbase.ReplayPage? Type41 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type42 { get; set; } + public global::Browserbase.Session? Type42 { get; set; } /// /// /// - public global::Browserbase.SessionLiveUrlsPage? Type43 { get; set; } + public global::Browserbase.SessionStatus? Type43 { get; set; } /// /// /// - public global::Browserbase.SessionLog? Type44 { get; set; } + public global::Browserbase.SessionRegion? Type44 { get; set; } /// /// /// - public global::Browserbase.SessionLogRequest? Type45 { get; set; } + public global::Browserbase.SessionLiveUrls? Type45 { get; set; } /// /// /// - public global::Browserbase.SessionLogResponse? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::Browserbase.SessionRecording? Type47 { get; set; } + public global::Browserbase.SessionLiveUrlsPage? Type47 { get; set; } /// /// /// - public global::Browserbase.CertificatesUploadRequest? Type48 { get; set; } + public global::Browserbase.SessionLog? Type48 { get; set; } /// /// /// - public byte[]? Type49 { get; set; } + public global::Browserbase.SessionLogRequest? Type49 { get; set; } /// /// /// - public global::Browserbase.ContextsCreateRequest? Type50 { get; set; } + public global::Browserbase.SessionLogResponse? Type50 { get; set; } /// /// /// - public global::Browserbase.ExtensionsUploadRequest? Type51 { get; set; } + public global::Browserbase.SessionRecording? Type51 { get; set; } /// /// /// - public global::Browserbase.FetchCreateRequest? Type52 { get; set; } + public global::Browserbase.AgentsCreateRequest? Type52 { get; set; } /// /// /// - public global::Browserbase.AnyOf? Type53 { get; set; } + public global::Browserbase.AgentRunsCreateRequest? Type53 { get; set; } /// /// /// - public global::Browserbase.FetchCreateRequestFormatVariant1? Type54 { get; set; } + public global::Browserbase.AgentRunsCreateRequestBrowserSettings? Type54 { get; set; } /// /// /// - public global::Browserbase.FetchCreateRequestFormatVariant2? Type55 { get; set; } + public global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext? Type55 { get; set; } /// /// /// - public global::Browserbase.FetchCreateRequestFormatVariant3? Type56 { get; set; } + public global::System.Collections.Generic.Dictionary? Type56 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequest? Type57 { get; set; } + public global::Browserbase.AgentRunsCreateRequestVariables2? Type57 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParams? Type58 { get; set; } + public global::Browserbase.AgentsUpdateRequest? Type58 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettings? Type59 { get; set; } + public global::Browserbase.CertificatesUploadRequest? Type59 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsContext? Type60 { get; set; } + public byte[]? Type60 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsViewport? Type61 { get; set; } + public global::Browserbase.ContextsCreateRequest? Type61 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsOs? Type62 { get; set; } + public global::Browserbase.ExtensionsUploadRequest? Type62 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsSize? Type63 { get; set; } + public global::Browserbase.FetchCreateRequest? Type63 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type64 { get; set; } + public global::Browserbase.AnyOf? Type64 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsExtension? Type65 { get; set; } + public global::Browserbase.FetchCreateRequestFormatVariant1? Type65 { get; set; } /// /// /// - public global::Browserbase.AnyOf>, bool?>? Type66 { get; set; } + public global::Browserbase.FetchCreateRequestFormatVariant2? Type66 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type67 { get; set; } + public global::Browserbase.FetchCreateRequestFormatVariant3? Type67 { get; set; } /// /// /// - public global::Browserbase.AnyOf? Type68 { get; set; } + public global::Browserbase.FunctionsInvokeRequest? Type68 { get; set; } /// /// /// - public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsProxySettings? Type69 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParams? Type69 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type70 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettings? Type70 { get; set; } /// /// /// - public global::Browserbase.SearchWebRequest? Type71 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsContext? Type71 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequest? Type72 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsViewport? Type72 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequestBrowserSettings? Type73 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsOs? Type73 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequestBrowserSettingsContext? Type74 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsSize? Type74 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequestBrowserSettingsViewport? Type75 { get; set; } + public global::System.Collections.Generic.IList? Type75 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequestBrowserSettingsOs? Type76 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsBrowserSettingsExtension? Type76 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequestProxySettings? Type77 { get; set; } + public global::Browserbase.AnyOf>, bool?>? Type77 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateRequestRegion? Type78 { get; set; } + public global::System.Collections.Generic.IList>? Type78 { get; set; } /// /// /// - public global::Browserbase.SessionsUpdateRequest? Type79 { get; set; } + public global::Browserbase.AnyOf? Type79 { get; set; } /// /// /// - public global::Browserbase.SessionsUpdateRequestStatus? Type80 { get; set; } + public global::Browserbase.FunctionsInvokeRequestSessionCreateParamsProxySettings? Type80 { get; set; } /// /// /// - public global::Browserbase.SessionsUploadFileRequest? Type81 { get; set; } + public global::System.Collections.Generic.IList? Type81 { get; set; } /// /// /// - public global::Browserbase.SessionsListStatus? Type82 { get; set; } + public global::Browserbase.SearchWebRequest? Type82 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type83 { get; set; } + public global::Browserbase.SessionsCreateRequest? Type83 { get; set; } /// /// /// - public global::Browserbase.ContextsCreateResponse? Type84 { get; set; } + public global::Browserbase.SessionsCreateRequestBrowserSettings? Type84 { get; set; } /// /// /// - public byte? Type85 { get; set; } + public global::Browserbase.SessionsCreateRequestBrowserSettingsContext? Type85 { get; set; } /// /// /// - public global::Browserbase.ContextsUpdateResponse? Type86 { get; set; } + public global::Browserbase.SessionsCreateRequestBrowserSettingsViewport? Type86 { get; set; } /// /// /// - public global::Browserbase.DownloadsListResponse? Type87 { get; set; } + public global::Browserbase.SessionsCreateRequestBrowserSettingsOs? Type87 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type88 { get; set; } + public global::Browserbase.SessionsCreateRequestProxySettings? Type88 { get; set; } /// /// /// - public global::Browserbase.DownloadsListResponseDownload? Type89 { get; set; } + public global::Browserbase.SessionsCreateRequestRegion? Type89 { get; set; } /// /// /// - public global::Browserbase.DownloadsGetResponse? Type90 { get; set; } + public global::Browserbase.SessionsUpdateRequest? Type90 { get; set; } /// /// /// - public global::Browserbase.FetchCreateResponse? Type91 { get; set; } + public global::Browserbase.SessionsUpdateRequestStatus? Type91 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type92 { get; set; } + public global::Browserbase.SessionsUploadFileRequest? Type92 { get; set; } /// /// /// - public global::Browserbase.AnyOf? Type93 { get; set; } + public global::Browserbase.AgentRunsListStatus? Type93 { get; set; } /// /// /// - public global::Browserbase.FetchCreateResponse2? Type94 { get; set; } + public global::Browserbase.SessionsListStatus? Type94 { get; set; } /// /// /// - public global::Browserbase.FetchCreateResponse5? Type95 { get; set; } + public global::Browserbase.AgentsListResponse? Type95 { get; set; } /// /// /// - public global::Browserbase.FetchCreateResponse6? Type96 { get; set; } + public global::System.Collections.Generic.IList? Type96 { get; set; } /// /// /// - public global::Browserbase.FetchCreateResponse7? Type97 { get; set; } + public global::Browserbase.AgentRunsListResponse? Type97 { get; set; } /// /// /// - public global::Browserbase.FetchCreateResponse8? Type98 { get; set; } + public global::System.Collections.Generic.IList? Type98 { get; set; } /// /// /// - public global::Browserbase.FunctionsListResponse? Type99 { get; set; } + public global::Browserbase.AgentRunsMessagesResponse? Type99 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type100 { get; set; } + public global::System.Collections.Generic.IList? Type100 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildsListResponse? Type101 { get; set; } + public global::Browserbase.AgentRunsMessagesResponseDataItem? Type101 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type102 { get; set; } + public global::Browserbase.AgentRunsMessagesResponseDataItemMessage? Type102 { get; set; } /// /// /// - public global::Browserbase.FunctionBuildsGetLogsResponse? Type103 { get; set; } + public global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole? Type103 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type104 { get; set; } + public global::Browserbase.OneOf>? Type104 { get; set; } /// /// /// - public global::Browserbase.AllOf? Type105 { get; set; } + public global::System.Collections.Generic.IList? Type105 { get; set; } /// /// /// - public global::Browserbase.InvocationsGetResponse2? Type106 { get; set; } + public global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item? Type106 { get; set; } /// /// /// - public global::Browserbase.InvocationsGetResponseCause? Type107 { get; set; } + public global::System.Collections.Generic.IList? Type107 { get; set; } /// /// /// - public global::Browserbase.InvocationsGetResponseCauseCode? Type108 { get; set; } + public global::Browserbase.ContextsCreateResponse? Type108 { get; set; } /// /// /// - public global::Browserbase.InvocationsGetLogsResponse? Type109 { get; set; } + public byte? Type109 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type110 { get; set; } + public global::Browserbase.ContextsUpdateResponse? Type110 { get; set; } /// /// /// - public global::Browserbase.FunctionVersionsListInvocationsResponse? Type111 { get; set; } + public global::Browserbase.DownloadsListResponse? Type111 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type112 { get; set; } + public global::System.Collections.Generic.IList? Type112 { get; set; } /// /// /// - public global::Browserbase.FunctionsListVersionsResponse? Type113 { get; set; } + public global::Browserbase.DownloadsListResponseDownload? Type113 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type114 { get; set; } + public global::Browserbase.DownloadsGetResponse? Type114 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type115 { get; set; } + public global::Browserbase.FetchCreateResponse? Type115 { get; set; } /// /// /// - public global::Browserbase.SearchWebResponse? Type116 { get; set; } + public global::System.Collections.Generic.Dictionary? Type116 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type117 { get; set; } + public global::Browserbase.AnyOf? Type117 { get; set; } /// /// /// - public global::Browserbase.SearchWebResponseResult? Type118 { get; set; } + public global::Browserbase.FetchCreateResponse2? Type118 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type119 { get; set; } + public global::Browserbase.FetchCreateResponse5? Type119 { get; set; } /// /// /// - public global::Browserbase.AllOf? Type120 { get; set; } + public global::Browserbase.FetchCreateResponse6? Type120 { get; set; } /// /// /// - public global::Browserbase.SessionsCreateResponse2? Type121 { get; set; } + public global::Browserbase.FetchCreateResponse7? Type121 { get; set; } /// /// /// - public global::Browserbase.AllOf? Type122 { get; set; } + public global::Browserbase.FetchCreateResponse8? Type122 { get; set; } /// /// /// - public global::Browserbase.SessionsGetResponse2? Type123 { get; set; } + public global::Browserbase.FunctionsListResponse? Type123 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type124 { get; set; } + public global::System.Collections.Generic.IList? Type124 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type125 { get; set; } + public global::Browserbase.FunctionBuildsListResponse? Type125 { get; set; } /// /// /// - public global::Browserbase.SessionsGetReplayResponse? Type126 { get; set; } + public global::System.Collections.Generic.IList? Type126 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type127 { get; set; } + public global::Browserbase.FunctionBuildsGetLogsResponse? Type127 { get; set; } /// /// /// - public global::Browserbase.SessionsUploadFileResponse? Type128 { get; set; } + public global::System.Collections.Generic.IList? Type128 { get; set; } + /// + /// + /// + public global::Browserbase.AllOf? Type129 { get; set; } + /// + /// + /// + public global::Browserbase.InvocationsGetResponse2? Type130 { get; set; } + /// + /// + /// + public global::Browserbase.InvocationsGetResponseCause? Type131 { get; set; } + /// + /// + /// + public global::Browserbase.InvocationsGetResponseCauseCode? Type132 { get; set; } + /// + /// + /// + public global::Browserbase.InvocationsGetLogsResponse? Type133 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type134 { get; set; } + /// + /// + /// + public global::Browserbase.FunctionVersionsListInvocationsResponse? Type135 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type136 { get; set; } + /// + /// + /// + public global::Browserbase.FunctionsListVersionsResponse? Type137 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type138 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type139 { get; set; } + /// + /// + /// + public global::Browserbase.SearchWebResponse? Type140 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type141 { get; set; } + /// + /// + /// + public global::Browserbase.SearchWebResponseResult? Type142 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type143 { get; set; } + /// + /// + /// + public global::Browserbase.AllOf? Type144 { get; set; } + /// + /// + /// + public global::Browserbase.SessionsCreateResponse2? Type145 { get; set; } + /// + /// + /// + public global::Browserbase.AllOf? Type146 { get; set; } + /// + /// + /// + public global::Browserbase.SessionsGetResponse2? Type147 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type148 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type149 { get; set; } + /// + /// + /// + public global::Browserbase.SessionsGetReplayResponse? Type150 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type151 { get; set; } + /// + /// + /// + public global::Browserbase.SessionsUploadFileResponse? Type152 { get; set; } /// /// @@ -581,58 +677,78 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::System.Collections.Generic.List? ListType9 { get; set; } + public global::System.Collections.Generic.List? ListType9 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType10 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType11 { get; set; } + /// + /// + /// + public global::Browserbase.OneOf>? ListType12 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType13 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.List? ListType14 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType10 { get; set; } + public global::System.Collections.Generic.List? ListType15 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType11 { get; set; } + public global::System.Collections.Generic.List? ListType16 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType12 { get; set; } + public global::System.Collections.Generic.List? ListType17 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType13 { get; set; } + public global::System.Collections.Generic.List? ListType18 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType14 { get; set; } + public global::System.Collections.Generic.List? ListType19 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType15 { get; set; } + public global::System.Collections.Generic.List? ListType20 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType16 { get; set; } + public global::System.Collections.Generic.List? ListType21 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType17 { get; set; } + public global::System.Collections.Generic.List? ListType22 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType18 { get; set; } + public global::System.Collections.Generic.List? ListType23 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType19 { get; set; } + public global::System.Collections.Generic.List? ListType24 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType20 { get; set; } + public global::System.Collections.Generic.List? ListType25 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType21 { get; set; } + public global::System.Collections.Generic.List? ListType26 { get; set; } /// /// /// - public global::System.Collections.Generic.List? ListType22 { get; set; } + public global::System.Collections.Generic.List? ListType27 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.Agent.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.Agent.Json.g.cs new file mode 100644 index 0000000..cede450 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.Agent.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class Agent + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.Agent? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.Agent), + jsonSerializerContext) as global::Browserbase.Agent; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.Agent? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.Agent? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.Agent), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.Agent; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.Agent.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.Agent.g.cs new file mode 100644 index 0000000..a1644e8 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.Agent.g.cs @@ -0,0 +1,101 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// A reusable agent. Referenced by `agentId` to apply a system prompt to every run that uses the agent. + /// + public sealed partial class Agent + { + /// + /// Unique identifier for the agent. Use this value as `agentId` when creating an agent run. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agentId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string AgentId { get; set; } + + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// System prompt applied to every run that uses this agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("systemPrompt")] + public string? SystemPrompt { get; set; } + + /// + /// [JSON Schema](https://json-schema.org/specification) that runs referencing this agent will aim to conform their `result` to. Can be overridden per run by passing `resultSchema` on the run request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resultSchema")] + public object? ResultSchema { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the agent. Use this value as `agentId` when creating an agent run. + /// + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// + /// + /// System prompt applied to every run that uses this agent. + /// + /// + /// [JSON Schema](https://json-schema.org/specification) that runs referencing this agent will aim to conform their `result` to. Can be overridden per run by passing `resultSchema` on the run request. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Agent( + string agentId, + string name, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string? systemPrompt, + object? resultSchema) + { + this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId)); + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.SystemPrompt = systemPrompt; + this.ResultSchema = resultSchema; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public Agent() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.Json.g.cs new file mode 100644 index 0000000..4154b0e --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentResultSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentResultSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentResultSchema), + jsonSerializerContext) as global::Browserbase.AgentResultSchema; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentResultSchema? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentResultSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentResultSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentResultSchema; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.g.cs new file mode 100644 index 0000000..cc48278 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentResultSchema.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// [JSON Schema](https://json-schema.org/specification) that runs referencing this agent will aim to conform their `result` to. Can be overridden per run by passing `resultSchema` on the run request. + /// + public sealed partial class AgentResultSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.Json.g.cs new file mode 100644 index 0000000..be0403c --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRun + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRun? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRun), + jsonSerializerContext) as global::Browserbase.AgentRun; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRun? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRun? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRun), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRun; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.g.cs new file mode 100644 index 0000000..0341887 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRun.g.cs @@ -0,0 +1,186 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// One execution of an agent against a task. Created in `pending` and transitioned through `running` → `completed`/`failed` by the runner. + /// + public sealed partial class AgentRun + { + /// + /// Unique identifier for the run. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("runId")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string RunId { get; set; } + + /// + /// The ID of the agent applied to this run, if any. Omitted for ad-hoc runs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agentId")] + public string? AgentId { get; set; } + + /// + /// The original task description. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("task")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Task { get; set; } + + /// + /// Current status of the run.
+ /// - `PENDING` - agent will run soon
+ /// - `RUNNING` - agent is currently running
+ /// - `COMPLETED` - agent has finished running
+ /// - `FAILED` - agent has failed the run
+ /// - `STOPPED` - run was stopped by the user
+ /// - `TIMED_OUT` - run exceeded maximum time + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("status")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Browserbase.JsonConverters.AgentRunStatusJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Browserbase.AgentRunStatus Status { get; set; } + + /// + /// The Browserbase session ID powering this run. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sessionId")] + public string? SessionId { get; set; } + + /// + /// External sandbox identifier assigned by the runner. Optional. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("sandboxId")] + public string? SandboxId { get; set; } + + /// + /// Per-run [JSON Schema](https://json-schema.org/specification) override for the result shape. When unset, the agent's default `resultSchema` applies. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resultSchema")] + public object? ResultSchema { get; set; } + + /// + /// The agent's structured result for the run. Only present when the run has finished and output is available. The result conforms to the provided [JSON Schema](https://json-schema.org/specification) when one is set. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("result")] + public object? Result { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("cause")] + public global::Browserbase.AgentRunCause? Cause { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public global::System.DateTime? StartedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("endedAt")] + public global::System.DateTime? EndedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("updatedAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime UpdatedAt { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Unique identifier for the run. + /// + /// + /// The original task description. + /// + /// + /// Current status of the run.
+ /// - `PENDING` - agent will run soon
+ /// - `RUNNING` - agent is currently running
+ /// - `COMPLETED` - agent has finished running
+ /// - `FAILED` - agent has failed the run
+ /// - `STOPPED` - run was stopped by the user
+ /// - `TIMED_OUT` - run exceeded maximum time + /// + /// + /// + /// + /// The ID of the agent applied to this run, if any. Omitted for ad-hoc runs. + /// + /// + /// The Browserbase session ID powering this run. + /// + /// + /// External sandbox identifier assigned by the runner. Optional. + /// + /// + /// Per-run [JSON Schema](https://json-schema.org/specification) override for the result shape. When unset, the agent's default `resultSchema` applies. + /// + /// + /// The agent's structured result for the run. Only present when the run has finished and output is available. The result conforms to the provided [JSON Schema](https://json-schema.org/specification) when one is set. + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRun( + string runId, + string task, + global::Browserbase.AgentRunStatus status, + global::System.DateTime createdAt, + global::System.DateTime updatedAt, + string? agentId, + string? sessionId, + string? sandboxId, + object? resultSchema, + object? result, + global::Browserbase.AgentRunCause? cause, + global::System.DateTime? startedAt, + global::System.DateTime? endedAt) + { + this.RunId = runId ?? throw new global::System.ArgumentNullException(nameof(runId)); + this.AgentId = agentId; + this.Task = task ?? throw new global::System.ArgumentNullException(nameof(task)); + this.Status = status; + this.SessionId = sessionId; + this.SandboxId = sandboxId; + this.ResultSchema = resultSchema; + this.Result = result; + this.Cause = cause; + this.StartedAt = startedAt; + this.EndedAt = endedAt; + this.CreatedAt = createdAt; + this.UpdatedAt = updatedAt; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRun() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.Json.g.cs new file mode 100644 index 0000000..b200cea --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunCause + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunCause? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunCause), + jsonSerializerContext) as global::Browserbase.AgentRunCause; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunCause? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunCause? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunCause), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunCause; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.g.cs new file mode 100644 index 0000000..38c6b91 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunCause.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunCause + { + /// + /// Structured failure code (e.g., RUNNER_HEARTBEAT_LOST). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Code { get; set; } + + /// + /// Human-readable failure detail. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + public string? Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Structured failure code (e.g., RUNNER_HEARTBEAT_LOST). + /// + /// + /// Human-readable failure detail. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunCause( + string code, + string? message) + { + this.Code = code ?? throw new global::System.ArgumentNullException(nameof(code)); + this.Message = message; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunCause() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.Json.g.cs new file mode 100644 index 0000000..70d1bf5 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunResult + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunResult? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunResult), + jsonSerializerContext) as global::Browserbase.AgentRunResult; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunResult? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunResult? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunResult), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunResult; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.g.cs new file mode 100644 index 0000000..068028d --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResult.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// The agent's structured result for the run. Only present when the run has finished and output is available. The result conforms to the provided [JSON Schema](https://json-schema.org/specification) when one is set. + /// + public sealed partial class AgentRunResult + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.Json.g.cs new file mode 100644 index 0000000..c20ff91 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunResultSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunResultSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunResultSchema), + jsonSerializerContext) as global::Browserbase.AgentRunResultSchema; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunResultSchema? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunResultSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunResultSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunResultSchema; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.g.cs new file mode 100644 index 0000000..1251144 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunResultSchema.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// Per-run [JSON Schema](https://json-schema.org/specification) override for the result shape. When unset, the agent's default `resultSchema` applies. + /// + public sealed partial class AgentRunResultSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunStatus.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunStatus.g.cs new file mode 100644 index 0000000..acf16c2 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunStatus.g.cs @@ -0,0 +1,81 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// Current status of the run.
+ /// - `PENDING` - agent will run soon
+ /// - `RUNNING` - agent is currently running
+ /// - `COMPLETED` - agent has finished running
+ /// - `FAILED` - agent has failed the run
+ /// - `STOPPED` - run was stopped by the user
+ /// - `TIMED_OUT` - run exceeded maximum time + ///
+ public enum AgentRunStatus + { + /// + /// + /// + Completed, + /// + /// + /// + Failed, + /// + /// + /// + Pending, + /// + /// + /// + Running, + /// + /// + /// + Stopped, + /// + /// + /// + TimedOut, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentRunStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentRunStatus value) + { + return value switch + { + AgentRunStatus.Completed => "COMPLETED", + AgentRunStatus.Failed => "FAILED", + AgentRunStatus.Pending => "PENDING", + AgentRunStatus.Running => "RUNNING", + AgentRunStatus.Stopped => "STOPPED", + AgentRunStatus.TimedOut => "TIMED_OUT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentRunStatus? ToEnum(string value) + { + return value switch + { + "COMPLETED" => AgentRunStatus.Completed, + "FAILED" => AgentRunStatus.Failed, + "PENDING" => AgentRunStatus.Pending, + "RUNNING" => AgentRunStatus.Running, + "STOPPED" => AgentRunStatus.Stopped, + "TIMED_OUT" => AgentRunStatus.TimedOut, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.Json.g.cs new file mode 100644 index 0000000..1cea7d7 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsCreateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsCreateRequest), + jsonSerializerContext) as global::Browserbase.AgentRunsCreateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsCreateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsCreateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsCreateRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.g.cs new file mode 100644 index 0000000..a4533b7 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequest.g.cs @@ -0,0 +1,91 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsCreateRequest + { + /// + /// Optionally run a specific [custom agent](/reference/api/create-an-agent) you've created by ID. The run will use the agent's `systemPrompt` and `resultSchema` unless overridden. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("agentId")] + public string? AgentId { get; set; } + + /// + /// A natural language description of the task the agent should accomplish. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("task")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Task { get; set; } + + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, the agent will aim to return a `result` that conforms to this schema when the run completes. Overrides the referenced agent's default `resultSchema` for this run only. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resultSchema")] + public object? ResultSchema { get; set; } + + /// + /// Browser configuration for the agent's session. When omitted, runner defaults apply. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("browserSettings")] + public global::Browserbase.AgentRunsCreateRequestBrowserSettings? BrowserSettings { get; set; } + + /// + /// Optional named variables the agent can reference as placeholders, i.e. `%variable%`. Each entry pairs a `value` the placeholder resolves to with an optional `description` that hints to the agent when it should be used. Values are not persisted. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("variables")] + public global::System.Collections.Generic.Dictionary? Variables { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// A natural language description of the task the agent should accomplish. + /// + /// + /// Optionally run a specific [custom agent](/reference/api/create-an-agent) you've created by ID. The run will use the agent's `systemPrompt` and `resultSchema` unless overridden. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, the agent will aim to return a `result` that conforms to this schema when the run completes. Overrides the referenced agent's default `resultSchema` for this run only. + /// + /// + /// Browser configuration for the agent's session. When omitted, runner defaults apply. + /// + /// + /// Optional named variables the agent can reference as placeholders, i.e. `%variable%`. Each entry pairs a `value` the placeholder resolves to with an optional `description` that hints to the agent when it should be used. Values are not persisted. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsCreateRequest( + string task, + string? agentId, + object? resultSchema, + global::Browserbase.AgentRunsCreateRequestBrowserSettings? browserSettings, + global::System.Collections.Generic.Dictionary? variables) + { + this.AgentId = agentId; + this.Task = task ?? throw new global::System.ArgumentNullException(nameof(task)); + this.ResultSchema = resultSchema; + this.BrowserSettings = browserSettings; + this.Variables = variables; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsCreateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.Json.g.cs new file mode 100644 index 0000000..a38affa --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsCreateRequestBrowserSettings + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestBrowserSettings? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsCreateRequestBrowserSettings), + jsonSerializerContext) as global::Browserbase.AgentRunsCreateRequestBrowserSettings; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestBrowserSettings? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsCreateRequestBrowserSettings? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsCreateRequestBrowserSettings), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsCreateRequestBrowserSettings; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.g.cs new file mode 100644 index 0000000..c24f393 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettings.g.cs @@ -0,0 +1,66 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// Browser configuration for the agent's session. When omitted, runner defaults apply. + /// + public sealed partial class AgentRunsCreateRequestBrowserSettings + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("context")] + public global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext? Context { get; set; } + + /// + /// Set true to route the agent's browser session through the default proxy. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("proxies")] + public bool? Proxies { get; set; } + + /// + /// Set true to enable Browserbase Verified for the session. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("verified")] + public bool? Verified { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// Set true to route the agent's browser session through the default proxy. + /// + /// + /// Set true to enable Browserbase Verified for the session. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsCreateRequestBrowserSettings( + global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext? context, + bool? proxies, + bool? verified) + { + this.Context = context; + this.Proxies = proxies; + this.Verified = verified; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsCreateRequestBrowserSettings() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.Json.g.cs new file mode 100644 index 0000000..164d12e --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsCreateRequestBrowserSettingsContext + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext), + jsonSerializerContext) as global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsCreateRequestBrowserSettingsContext; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.g.cs new file mode 100644 index 0000000..3877344 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestBrowserSettingsContext.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsCreateRequestBrowserSettingsContext + { + /// + /// The Context ID. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// Whether to persist the context after browsing. Defaults to false. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("persist")] + public bool? Persist { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The Context ID. + /// + /// + /// Whether to persist the context after browsing. Defaults to false. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsCreateRequestBrowserSettingsContext( + string id, + bool? persist) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.Persist = persist; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsCreateRequestBrowserSettingsContext() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.Json.g.cs new file mode 100644 index 0000000..ee2b1d3 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsCreateRequestResultSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestResultSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsCreateRequestResultSchema), + jsonSerializerContext) as global::Browserbase.AgentRunsCreateRequestResultSchema; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestResultSchema? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsCreateRequestResultSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsCreateRequestResultSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsCreateRequestResultSchema; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.g.cs new file mode 100644 index 0000000..018b321 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestResultSchema.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, the agent will aim to return a `result` that conforms to this schema when the run completes. Overrides the referenced agent's default `resultSchema` for this run only. + /// + public sealed partial class AgentRunsCreateRequestResultSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.Json.g.cs new file mode 100644 index 0000000..95cbb40 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsCreateRequestVariables + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestVariables? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsCreateRequestVariables), + jsonSerializerContext) as global::Browserbase.AgentRunsCreateRequestVariables; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestVariables? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsCreateRequestVariables? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsCreateRequestVariables), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsCreateRequestVariables; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.g.cs new file mode 100644 index 0000000..5cb0f99 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// Optional named variables the agent can reference as placeholders, i.e. `%variable%`. Each entry pairs a `value` the placeholder resolves to with an optional `description` that hints to the agent when it should be used. Values are not persisted. + /// + public sealed partial class AgentRunsCreateRequestVariables + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.Json.g.cs new file mode 100644 index 0000000..a77baa0 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsCreateRequestVariables2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestVariables2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsCreateRequestVariables2), + jsonSerializerContext) as global::Browserbase.AgentRunsCreateRequestVariables2; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsCreateRequestVariables2? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsCreateRequestVariables2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsCreateRequestVariables2), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsCreateRequestVariables2; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.g.cs new file mode 100644 index 0000000..164c677 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsCreateRequestVariables2.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsCreateRequestVariables2 + { + /// + /// The value the placeholder resolves to when the agent uses it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("value")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Value { get; set; } + + /// + /// Optional hint to the agent describing what this variable represents and when to use it. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The value the placeholder resolves to when the agent uses it. + /// + /// + /// Optional hint to the agent describing what this variable represents and when to use it. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsCreateRequestVariables2( + string value, + string? description) + { + this.Value = value ?? throw new global::System.ArgumentNullException(nameof(value)); + this.Description = description; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsCreateRequestVariables2() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.Json.g.cs new file mode 100644 index 0000000..6ee1ee2 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsListResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsListResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsListResponse), + jsonSerializerContext) as global::Browserbase.AgentRunsListResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsListResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsListResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsListResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.g.cs new file mode 100644 index 0000000..27e62e5 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// A page of agent runs. + /// + public sealed partial class AgentRunsListResponse + { + /// + /// The page of matching agent runs. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// The maximum number of results returned in this page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("limit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Limit { get; set; } + + /// + /// Cursor for the next page. Pass it back as `cursor` on the next request to continue paging. null when there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The page of matching agent runs. + /// + /// + /// The maximum number of results returned in this page. + /// + /// + /// Cursor for the next page. Pass it back as `cursor` on the next request to continue paging. null when there are no more results. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsListResponse( + global::System.Collections.Generic.IList data, + int limit, + string? nextCursor) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Limit = limit; + this.NextCursor = nextCursor; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsListResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListStatus.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListStatus.g.cs new file mode 100644 index 0000000..7b0925b --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsListStatus.g.cs @@ -0,0 +1,75 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public enum AgentRunsListStatus + { + /// + /// + /// + Completed, + /// + /// + /// + Failed, + /// + /// + /// + Pending, + /// + /// + /// + Running, + /// + /// + /// + Stopped, + /// + /// + /// + TimedOut, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentRunsListStatusExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentRunsListStatus value) + { + return value switch + { + AgentRunsListStatus.Completed => "COMPLETED", + AgentRunsListStatus.Failed => "FAILED", + AgentRunsListStatus.Pending => "PENDING", + AgentRunsListStatus.Running => "RUNNING", + AgentRunsListStatus.Stopped => "STOPPED", + AgentRunsListStatus.TimedOut => "TIMED_OUT", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentRunsListStatus? ToEnum(string value) + { + return value switch + { + "COMPLETED" => AgentRunsListStatus.Completed, + "FAILED" => AgentRunsListStatus.Failed, + "PENDING" => AgentRunsListStatus.Pending, + "RUNNING" => AgentRunsListStatus.Running, + "STOPPED" => AgentRunsListStatus.Stopped, + "TIMED_OUT" => AgentRunsListStatus.TimedOut, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.Json.g.cs new file mode 100644 index 0000000..30e715b --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsMessagesResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsMessagesResponse), + jsonSerializerContext) as global::Browserbase.AgentRunsMessagesResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponse? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsMessagesResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsMessagesResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsMessagesResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.g.cs new file mode 100644 index 0000000..643f2a9 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponse.g.cs @@ -0,0 +1,58 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsMessagesResponse + { + /// + /// The page of messages, in chronological order, with the oldest messages first. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// The `id` of the last message in `data`. Pass it back as `since` on the next request to continue paging, or to poll for new messages. `null` only when the run has no messages yet; in that case, omit `since` and retry. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nextSince")] + public string? NextSince { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The page of messages, in chronological order, with the oldest messages first. + /// + /// + /// The `id` of the last message in `data`. Pass it back as `since` on the next request to continue paging, or to poll for new messages. `null` only when the run has no messages yet; in that case, omit `since` and retry. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsMessagesResponse( + global::System.Collections.Generic.IList data, + string? nextSince) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.NextSince = nextSince; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsMessagesResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.Json.g.cs new file mode 100644 index 0000000..b8dd572 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsMessagesResponseDataItem + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItem? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItem), + jsonSerializerContext) as global::Browserbase.AgentRunsMessagesResponseDataItem; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItem? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsMessagesResponseDataItem? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItem), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsMessagesResponseDataItem; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.g.cs new file mode 100644 index 0000000..dd4a299 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItem.g.cs @@ -0,0 +1,67 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsMessagesResponseDataItem + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("id")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Id { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("createdAt")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.DateTime CreatedAt { get; set; } + + /// + /// An AI SDK response message (assistant or tool). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("message")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Browserbase.AgentRunsMessagesResponseDataItemMessage Message { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// An AI SDK response message (assistant or tool). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsMessagesResponseDataItem( + string id, + global::System.DateTime createdAt, + global::Browserbase.AgentRunsMessagesResponseDataItemMessage message) + { + this.Id = id ?? throw new global::System.ArgumentNullException(nameof(id)); + this.CreatedAt = createdAt; + this.Message = message ?? throw new global::System.ArgumentNullException(nameof(message)); + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsMessagesResponseDataItem() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.Json.g.cs new file mode 100644 index 0000000..f05e016 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsMessagesResponseDataItemMessage + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessage? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessage), + jsonSerializerContext) as global::Browserbase.AgentRunsMessagesResponseDataItemMessage; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessage? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessage? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessage), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsMessagesResponseDataItemMessage; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.g.cs new file mode 100644 index 0000000..2fc294c --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessage.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// An AI SDK response message (assistant or tool). + /// + public sealed partial class AgentRunsMessagesResponseDataItemMessage + { + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("role")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Browserbase.JsonConverters.AgentRunsMessagesResponseDataItemMessageRoleJsonConverter))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole Role { get; set; } + + /// + /// Plain string (assistant text) or an array of typed parts. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("content")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Browserbase.JsonConverters.OneOfJsonConverter>))] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::Browserbase.OneOf> Content { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// Plain string (assistant text) or an array of typed parts. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsMessagesResponseDataItemMessage( + global::Browserbase.AgentRunsMessagesResponseDataItemMessageRole role, + global::Browserbase.OneOf> content) + { + this.Role = role; + this.Content = content; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsMessagesResponseDataItemMessage() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.Json.g.cs new file mode 100644 index 0000000..6600ecb --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsMessagesResponseDataItemMessageContentVariant2Item + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item), + jsonSerializerContext) as global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2Item; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.g.cs new file mode 100644 index 0000000..7e26c9d --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2Item.g.cs @@ -0,0 +1,110 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsMessagesResponseDataItemMessageContentVariant2Item + { + /// + /// text | reasoning | file | tool-call | tool-result + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Type { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("text")] + public string? Text { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("toolCallId")] + public string? ToolCallId { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("toolName")] + public string? ToolName { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("input")] + public object? Input { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("output")] + public object? Output { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("mediaType")] + public string? MediaType { get; set; } + + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + public string? Data { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// text | reasoning | file | tool-call | tool-result + /// + /// + /// + /// + /// + /// + /// + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentRunsMessagesResponseDataItemMessageContentVariant2Item( + string type, + string? text, + string? toolCallId, + string? toolName, + object? input, + object? output, + string? mediaType, + string? data) + { + this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); + this.Text = text; + this.ToolCallId = toolCallId; + this.ToolName = toolName; + this.Input = input; + this.Output = output; + this.MediaType = mediaType; + this.Data = data; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentRunsMessagesResponseDataItemMessageContentVariant2Item() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.Json.g.cs new file mode 100644 index 0000000..5bcafac --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput), + jsonSerializerContext) as global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.g.cs new file mode 100644 index 0000000..74c4bbc --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsMessagesResponseDataItemMessageContentVariant2ItemInput + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.Json.g.cs new file mode 100644 index 0000000..11df711 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput), + jsonSerializerContext) as global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.g.cs new file mode 100644 index 0000000..4406e44 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentRunsMessagesResponseDataItemMessageContentVariant2ItemOutput + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageRole.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageRole.g.cs new file mode 100644 index 0000000..c453255 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentRunsMessagesResponseDataItemMessageRole.g.cs @@ -0,0 +1,51 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public enum AgentRunsMessagesResponseDataItemMessageRole + { + /// + /// + /// + Assistant, + /// + /// + /// + Tool, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AgentRunsMessagesResponseDataItemMessageRoleExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AgentRunsMessagesResponseDataItemMessageRole value) + { + return value switch + { + AgentRunsMessagesResponseDataItemMessageRole.Assistant => "assistant", + AgentRunsMessagesResponseDataItemMessageRole.Tool => "tool", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AgentRunsMessagesResponseDataItemMessageRole? ToEnum(string value) + { + return value switch + { + "assistant" => AgentRunsMessagesResponseDataItemMessageRole.Assistant, + "tool" => AgentRunsMessagesResponseDataItemMessageRole.Tool, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.Json.g.cs new file mode 100644 index 0000000..601f38d --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentsCreateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentsCreateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentsCreateRequest), + jsonSerializerContext) as global::Browserbase.AgentsCreateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentsCreateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentsCreateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentsCreateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentsCreateRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.g.cs new file mode 100644 index 0000000..217b9d2 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequest.g.cs @@ -0,0 +1,69 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentsCreateRequest + { + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + [global::System.Text.Json.Serialization.JsonRequired] + public required string Name { get; set; } + + /// + /// System prompt that steers the agent's behavior on every run that uses this agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("systemPrompt")] + public string? SystemPrompt { get; set; } + + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resultSchema")] + public object? ResultSchema { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// System prompt that steers the agent's behavior on every run that uses this agent. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentsCreateRequest( + string name, + string? systemPrompt, + object? resultSchema) + { + this.Name = name ?? throw new global::System.ArgumentNullException(nameof(name)); + this.SystemPrompt = systemPrompt; + this.ResultSchema = resultSchema; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentsCreateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.Json.g.cs new file mode 100644 index 0000000..a77258b --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentsCreateRequestResultSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentsCreateRequestResultSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentsCreateRequestResultSchema), + jsonSerializerContext) as global::Browserbase.AgentsCreateRequestResultSchema; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentsCreateRequestResultSchema? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentsCreateRequestResultSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentsCreateRequestResultSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentsCreateRequestResultSchema; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.g.cs new file mode 100644 index 0000000..702296c --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsCreateRequestResultSchema.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + public sealed partial class AgentsCreateRequestResultSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.Json.g.cs new file mode 100644 index 0000000..e70447b --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentsListResponse + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentsListResponse? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentsListResponse), + jsonSerializerContext) as global::Browserbase.AgentsListResponse; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentsListResponse? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentsListResponse? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentsListResponse), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentsListResponse; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.g.cs new file mode 100644 index 0000000..12066c2 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsListResponse.g.cs @@ -0,0 +1,70 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// A page of agents. + /// + public sealed partial class AgentsListResponse + { + /// + /// The page of matching agents. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::System.Collections.Generic.IList Data { get; set; } + + /// + /// The maximum number of results returned in this page. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("limit")] + [global::System.Text.Json.Serialization.JsonRequired] + public required int Limit { get; set; } + + /// + /// Cursor for the next page. Pass it back as `cursor` on the next request to continue paging. null when there are no more results. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("nextCursor")] + public string? NextCursor { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The page of matching agents. + /// + /// + /// The maximum number of results returned in this page. + /// + /// + /// Cursor for the next page. Pass it back as `cursor` on the next request to continue paging. null when there are no more results. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentsListResponse( + global::System.Collections.Generic.IList data, + int limit, + string? nextCursor) + { + this.Data = data ?? throw new global::System.ArgumentNullException(nameof(data)); + this.Limit = limit; + this.NextCursor = nextCursor; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentsListResponse() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.Json.g.cs new file mode 100644 index 0000000..5f55e96 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentsUpdateRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentsUpdateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentsUpdateRequest), + jsonSerializerContext) as global::Browserbase.AgentsUpdateRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentsUpdateRequest? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentsUpdateRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentsUpdateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentsUpdateRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.g.cs new file mode 100644 index 0000000..db118cd --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequest.g.cs @@ -0,0 +1,68 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public sealed partial class AgentsUpdateRequest + { + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("name")] + public string? Name { get; set; } + + /// + /// New system prompt that steers the agent's behavior on every run that uses this agent. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("systemPrompt")] + public string? SystemPrompt { get; set; } + + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("resultSchema")] + public object? ResultSchema { get; set; } + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Human-readable name for the agent. Used to identify the agent in the dashboard and API responses. + /// + /// + /// New system prompt that steers the agent's behavior on every run that uses this agent. + /// + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public AgentsUpdateRequest( + string? name, + string? systemPrompt, + object? resultSchema) + { + this.Name = name; + this.SystemPrompt = systemPrompt; + this.ResultSchema = resultSchema; + } + + /// + /// Initializes a new instance of the class. + /// + public AgentsUpdateRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.Json.g.cs new file mode 100644 index 0000000..c93757d --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public sealed partial class AgentsUpdateRequestResultSchema + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.AgentsUpdateRequestResultSchema? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.AgentsUpdateRequestResultSchema), + jsonSerializerContext) as global::Browserbase.AgentsUpdateRequestResultSchema; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.AgentsUpdateRequestResultSchema? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.AgentsUpdateRequestResultSchema? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.AgentsUpdateRequestResultSchema), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.AgentsUpdateRequestResultSchema; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.g.cs b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.g.cs new file mode 100644 index 0000000..cbea36d --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.Models.AgentsUpdateRequestResultSchema.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// An optional [JSON Schema](https://json-schema.org/specification) object. If provided, runs that reference this agent will aim to return a `result` that conforms to this schema when they complete. Can be overridden per run by passing `resultSchema` on the run request. + /// + public sealed partial class AgentsUpdateRequestResultSchema + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/Browserbase/Generated/Browserbase.OneOf.2.Json.g.cs b/src/libs/Browserbase/Generated/Browserbase.OneOf.2.Json.g.cs new file mode 100644 index 0000000..a96b151 --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.OneOf.2.Json.g.cs @@ -0,0 +1,141 @@ +#nullable enable + +namespace Browserbase +{ + public readonly partial struct OneOf + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::Browserbase.OneOf? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Browserbase.OneOf), + jsonSerializerContext) as global::Browserbase.OneOf?; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::Browserbase.OneOf? FromJson( + string json) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::Browserbase.OneOf? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize>( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::Browserbase.OneOf), + jsonSerializerContext).ConfigureAwait(false)) as global::Browserbase.OneOf?; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask?> FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::Browserbase.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync?>( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/Browserbase/Generated/Browserbase.OneOf.2.g.cs b/src/libs/Browserbase/Generated/Browserbase.OneOf.2.g.cs new file mode 100644 index 0000000..39ae42c --- /dev/null +++ b/src/libs/Browserbase/Generated/Browserbase.OneOf.2.g.cs @@ -0,0 +1,294 @@ + +#nullable enable + +namespace Browserbase +{ + /// + /// + /// + public readonly partial struct OneOf : global::System.IEquatable> + { + /// + /// + /// +#if NET6_0_OR_GREATER + public T1? Value1 { get; init; } +#else + public T1? Value1 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value1))] +#endif + public bool IsValue1 => Value1 != null; + + /// + /// + /// + public bool TryPickValue1( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T1? value) + { + value = Value1; + return IsValue1; + } + + /// + /// + /// + public T1 PickValue1() => IsValue1 + ? Value1! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value1' but the value was {ToString()}."); + + /// + /// + /// +#if NET6_0_OR_GREATER + public T2? Value2 { get; init; } +#else + public T2? Value2 { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Value2))] +#endif + public bool IsValue2 => Value2 != null; + + /// + /// + /// + public bool TryPickValue2( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out T2? value) + { + value = Value2; + return IsValue2; + } + + /// + /// + /// + public T2 PickValue2() => IsValue2 + ? Value2! + : throw new global::System.InvalidOperationException($"Expected union variant 'Value2' but the value was {ToString()}."); + /// + /// + /// + public static implicit operator OneOf(T1 value) => new OneOf((T1?)value); + + /// + /// + /// + public static implicit operator T1?(OneOf @this) => @this.Value1; + + /// + /// + /// + public OneOf(T1? value) + { + Value1 = value; + } + + /// + /// + /// + public static OneOf FromValue1(T1? value) => new OneOf(value); + + /// + /// + /// + public static implicit operator OneOf(T2 value) => new OneOf((T2?)value); + + /// + /// + /// + public static implicit operator T2?(OneOf @this) => @this.Value2; + + /// + /// + /// + public OneOf(T2? value) + { + Value2 = value; + } + + /// + /// + /// + public static OneOf FromValue2(T2? value) => new OneOf(value); + + /// + /// + /// + public OneOf( + T1? value1, + T2? value2 + ) + { + Value1 = value1; + Value2 = value2; + } + + /// + /// + /// + public object? Object => + Value2 as object ?? + Value1 as object + ; + + /// + /// + /// + public override string? ToString() => + Value1?.ToString() ?? + Value2?.ToString() + ; + + /// + /// + /// + public bool Validate() + { + return IsValue1 && !IsValue2 || !IsValue1 && IsValue2; + } + + /// + /// + /// + public TResult? Match( + global::System.Func? value1 = null, + global::System.Func? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1 && value1 != null) + { + return value1(Value1!); + } + else if (IsValue2 && value2 != null) + { + return value2(Value2!); + } + + return default(TResult); + } + + /// + /// + /// + public void Match( + global::System.Action? value1 = null, + + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public void Switch( + global::System.Action? value1 = null, + global::System.Action? value2 = null, + bool validate = true) + { + if (validate) + { + Validate(); + } + + if (IsValue1) + { + value1?.Invoke(Value1!); + } + else if (IsValue2) + { + value2?.Invoke(Value2!); + } + } + + /// + /// + /// + public override int GetHashCode() + { + var fields = new object?[] + { + Value1, + typeof(T1), + Value2, + typeof(T2), + }; + const int offset = unchecked((int)2166136261); + const int prime = 16777619; + static int HashCodeAggregator(int hashCode, object? value) => value == null + ? (hashCode ^ 0) * prime + : (hashCode ^ value.GetHashCode()) * prime; + + return global::System.Linq.Enumerable.Aggregate(fields, offset, HashCodeAggregator); + } + + /// + /// + /// + public bool Equals(OneOf other) + { + return + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value1, other.Value1) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Value2, other.Value2) + ; + } + + /// + /// + /// + public static bool operator ==(OneOf obj1, OneOf obj2) + { + return global::System.Collections.Generic.EqualityComparer>.Default.Equals(obj1, obj2); + } + + /// + /// + /// + public static bool operator !=(OneOf obj1, OneOf obj2) + { + return !(obj1 == obj2); + } + + /// + /// + /// + public override bool Equals(object? obj) + { + return obj is OneOf o && Equals(o); + } + } +} diff --git a/src/libs/Browserbase/openapi.yaml b/src/libs/Browserbase/openapi.yaml index 74f22b3..ae039a8 100644 --- a/src/libs/Browserbase/openapi.yaml +++ b/src/libs/Browserbase/openapi.yaml @@ -4,10 +4,564 @@ info: description: Browserbase API for 3rd party developers version: v1 servers: - - url: "https://api.browserbase.com" + - url: https://api.browserbase.com description: Public endpoint variables: {} paths: + /v1/agents: + post: + operationId: Agents_create + summary: Create an Agent + description: >- + Create a reusable agent. An agent defines a `systemPrompt` and + `resultSchema` that guide its behavior for every run. Only `name` is + required; an agent created with no `systemPrompt` behaves like an + unconfigured run. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + description: >- + Human-readable name for the agent. Used to identify the + agent in the dashboard and API responses. + type: string + maxLength: 255 + minLength: 1 + systemPrompt: + description: >- + System prompt that steers the agent's behavior on every run + that uses this agent. + type: string + minLength: 1 + resultSchema: + description: >- + An optional [JSON + Schema](https://json-schema.org/specification) object. If + provided, runs that reference this agent will aim to return + a `result` that conforms to this schema when they complete. + Can be overridden per run by passing `resultSchema` on the + run request. + type: object + additionalProperties: true + properties: {} + additionalProperties: false + required: + - name + responses: + '201': + description: The agent has been created. + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' + get: + operationId: Agents_list + summary: List Agents + description: List agents across your account. Supports filtering by creation time. + parameters: + - name: startAt + in: query + description: >- + Only return agents created on or after this timestamp (inclusive). + ISO 8601 / RFC 3339, e.g. 2026-01-19T00:00:00Z. + required: false + schema: + type: string + format: date-time + - name: endAt + in: query + description: >- + Only return agents created on or before this timestamp (inclusive). + ISO 8601 / RFC 3339, e.g. 2026-01-20T00:00:00Z. + required: false + schema: + type: string + format: date-time + - name: limit + in: query + description: Maximum number of results to return. + required: false + schema: + type: integer + default: 20 + maximum: 1000 + minimum: 1 + - name: cursor + in: query + description: >- + Pagination cursor. Pass the nextCursor from the previous response to + fetch the next page. Omit to start from the first page. + required: false + schema: + type: string + responses: + '200': + description: The page of matching agents. + content: + application/json: + schema: + description: A page of agents. + type: object + properties: + data: + description: The page of matching agents. + type: array + items: + $ref: '#/components/schemas/Agent' + limit: + description: The maximum number of results returned in this page. + type: integer + nextCursor: + description: >- + Cursor for the next page. Pass it back as `cursor` on the + next request to continue paging. null when there are no + more results. + anyOf: + - type: string + nullable: true + required: + - data + - limit + - nextCursor + /v1/agents/runs: + post: + operationId: AgentRuns_create + summary: Run an Agent + description: >- + Run a browser agent to complete the `task` by using web search and + browser tooling. Optionally pass `agentId` to run a [custom + agent](/reference/api/create-an-agent) you've created. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + agentId: + description: >- + Optionally run a specific [custom + agent](/reference/api/create-an-agent) you've created by ID. + The run will use the agent's `systemPrompt` and + `resultSchema` unless overridden. + type: string + task: + description: >- + A natural language description of the task the agent should + accomplish. + type: string + minLength: 1 + resultSchema: + description: >- + An optional [JSON + Schema](https://json-schema.org/specification) object. If + provided, the agent will aim to return a `result` that + conforms to this schema when the run completes. Overrides + the referenced agent's default `resultSchema` for this run + only. + type: object + additionalProperties: true + properties: {} + browserSettings: + description: >- + Browser configuration for the agent's session. When omitted, + runner defaults apply. + type: object + additionalProperties: false + properties: + context: + type: object + additionalProperties: false + properties: + id: + description: The Context ID. + type: string + persist: + description: >- + Whether to persist the context after browsing. + Defaults to false. + type: boolean + required: + - id + proxies: + description: >- + Set true to route the agent's browser session through + the default proxy. + type: boolean + verified: + description: Set true to enable Browserbase Verified for the session. + type: boolean + variables: + description: >- + Optional named variables the agent can reference as + placeholders, i.e. `%variable%`. Each entry pairs a `value` + the placeholder resolves to with an optional `description` + that hints to the agent when it should be used. Values are + not persisted. + type: object + additionalProperties: + additionalProperties: false + type: object + properties: + value: + description: >- + The value the placeholder resolves to when the agent + uses it. + type: string + description: + description: >- + Optional hint to the agent describing what this + variable represents and when to use it. + type: string + required: + - value + additionalProperties: false + required: + - task + responses: + '201': + description: The agent run has been created in `pending` state. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRun' + get: + operationId: AgentRuns_list + summary: List Runs + description: >- + List runs across your account. Supports filtering by status, by the + agent they reference, and by creation time. + parameters: + - name: status + in: query + description: |- + Current status of the run. + - `PENDING` - agent will run soon + - `RUNNING` - agent is currently running + - `COMPLETED` - agent has finished running + - `FAILED` - agent has failed the run + - `STOPPED` - run was stopped by the user + - `TIMED_OUT` - run exceeded maximum time + required: false + schema: + type: string + enum: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - STOPPED + - TIMED_OUT + - name: agentId + in: query + description: Only return runs that reference this agent ID. + required: false + schema: + type: string + - name: startAt + in: query + description: >- + Only return runs created on or after this timestamp (inclusive). ISO + 8601 / RFC 3339, e.g. 2026-01-19T00:00:00Z. + required: false + schema: + type: string + format: date-time + - name: endAt + in: query + description: >- + Only return runs created on or before this timestamp (inclusive). + ISO 8601 / RFC 3339, e.g. 2026-01-20T00:00:00Z. + required: false + schema: + type: string + format: date-time + - name: limit + in: query + description: Maximum number of results to return. + required: false + schema: + type: integer + default: 20 + maximum: 1000 + minimum: 1 + - name: cursor + in: query + description: >- + Pagination cursor. Pass the nextCursor from the previous response to + fetch the next page. Omit to start from the first page. + required: false + schema: + type: string + responses: + '200': + description: The page of matching agent runs. + content: + application/json: + schema: + description: A page of agent runs. + type: object + properties: + data: + description: The page of matching agent runs. + type: array + items: + $ref: '#/components/schemas/AgentRun' + limit: + description: The maximum number of results returned in this page. + type: integer + nextCursor: + description: >- + Cursor for the next page. Pass it back as `cursor` on the + next request to continue paging. null when there are no + more results. + anyOf: + - type: string + nullable: true + required: + - data + - limit + - nextCursor + /v1/agents/runs/{runId}: + get: + operationId: AgentRuns_get + summary: Get a Run + description: >- + Retrieve the current status and details of a run, including its result + and associated session information. To fetch the run's messages, use + [List Run Messages](/reference/api/list-run-messages). + parameters: + - name: runId + in: path + description: The run ID. + required: true + schema: + type: string + responses: + '200': + description: The agent run. + content: + application/json: + schema: + $ref: '#/components/schemas/AgentRun' + /v1/agents/runs/{runId}/messages: + get: + operationId: AgentRuns_messages + summary: List Run Messages + description: >- + Returns a paginated list of messages produced by a run, in chronological + order, with the oldest messages first. + + + Messages conform to the [AI SDK UIMessage + format](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message). + parameters: + - name: since + in: query + description: >- + The `id` of the last message you've already received. The response + will contain messages produced after that one, in chronological + order. Omit on the first call. Pass the previous response's + `nextSince` value to continue paging or to poll for new messages. + required: false + schema: + type: string + - name: limit + in: query + description: Maximum number of messages to return. + required: false + schema: + type: integer + default: 20 + maximum: 100 + minimum: 1 + - name: all + in: query + description: >- + Return every message after `since` in one response, ignoring + `limit`. + required: false + schema: + type: boolean + default: false + - name: runId + in: path + description: The run ID. + required: true + schema: + type: string + format: uuid + responses: + '200': + description: >- + The page of messages, in chronological order, with the oldest + messages first. + content: + application/json: + schema: + type: object + properties: + data: + description: >- + The page of messages, in chronological order, with the + oldest messages first. + type: array + items: + type: object + required: + - id + - createdAt + - message + properties: + id: + type: string + createdAt: + type: string + format: date-time + message: + description: An AI SDK response message (assistant or tool). + type: object + additionalProperties: true + properties: + role: + type: string + enum: + - assistant + - tool + content: + description: >- + Plain string (assistant text) or an array of + typed parts. + oneOf: + - type: string + - type: array + items: + type: object + required: + - type + additionalProperties: true + properties: + type: + description: >- + text | reasoning | file | tool-call | + tool-result + type: string + text: + type: string + toolCallId: + type: string + toolName: + type: string + input: {} + output: {} + mediaType: + type: string + data: + type: string + required: + - role + - content + nextSince: + description: >- + The `id` of the last message in `data`. Pass it back as + `since` on the next request to continue paging, or to poll + for new messages. `null` only when the run has no messages + yet; in that case, omit `since` and retry. + type: string + nullable: true + required: + - data + - nextSince + /v1/agents/{agentId}: + get: + operationId: Agents_get + summary: Get an Agent + description: Retrieve an agent by ID. + parameters: + - name: agentId + in: path + description: The agent ID. + required: true + schema: + type: string + responses: + '200': + description: The agent. + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' + patch: + operationId: Agents_update + summary: Update an Agent + description: >- + Update an existing agent. Only the fields provided in the body are + modified; omitted fields are left unchanged. + parameters: + - name: agentId + in: path + description: The agent ID. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + description: >- + Human-readable name for the agent. Used to identify the + agent in the dashboard and API responses. + type: string + maxLength: 255 + minLength: 1 + systemPrompt: + description: >- + New system prompt that steers the agent's behavior on every + run that uses this agent. + type: string + minLength: 1 + resultSchema: + description: >- + An optional [JSON + Schema](https://json-schema.org/specification) object. If + provided, runs that reference this agent will aim to return + a `result` that conforms to this schema when they complete. + Can be overridden per run by passing `resultSchema` on the + run request. + type: object + additionalProperties: true + properties: {} + additionalProperties: false + responses: + '200': + description: The updated agent. + content: + application/json: + schema: + $ref: '#/components/schemas/Agent' + delete: + operationId: Agents_delete + summary: Delete an Agent + description: Delete an agent. Runs that already referenced this agent are unaffected. + parameters: + - name: agentId + in: path + description: The agent ID. + required: true + schema: + type: string + responses: + '204': + description: >- + The agent has been deleted. Idempotent: deleting an already-deleted + or non-existent agent returns 204. /v1/certificates: post: operationId: Certificates_upload @@ -25,25 +579,25 @@ paths: required: - file responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Certificate" + $ref: '#/components/schemas/Certificate' get: operationId: Certificates_list summary: List Certificates responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: type: array items: - $ref: "#/components/schemas/Certificate" - "/v1/certificates/{id}": + $ref: '#/components/schemas/Certificate' + /v1/certificates/{id}: get: operationId: Certificates_get summary: Get a Certificate @@ -54,12 +608,12 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Certificate" + $ref: '#/components/schemas/Certificate' delete: operationId: Certificates_delete summary: Delete a Certificate @@ -70,8 +624,10 @@ paths: schema: type: string responses: - "204": - description: "There is no content to send for this request, but the headers may be useful." + '204': + description: >- + There is no content to send for this request, but the headers may be + useful. /v1/contexts: post: operationId: Contexts_create @@ -83,11 +639,17 @@ paths: type: object properties: projectId: - description: "The Project ID. Can be found in [Settings](https://www.browserbase.com/settings). Optional - if not provided, the project will be inferred from the API key." + description: >- + The Project ID. Can be found in + [Settings](https://www.browserbase.com/settings). Optional - + if not provided, the project will be inferred from the API + key. type: string responses: - "201": - description: The request has succeeded and a new resource has been created as a result. + '201': + description: >- + The request has succeeded and a new resource has been created as a + result. content: application/json: schema: @@ -103,10 +665,16 @@ paths: description: The public key to encrypt the user-data-directory. type: string cipherAlgorithm: - description: The cipher algorithm used to encrypt the user-data-directory. AES-256-CBC is currently the only supported algorithm. + description: >- + The cipher algorithm used to encrypt the + user-data-directory. AES-256-CBC is currently the only + supported algorithm. type: string initializationVectorSize: - description: "The initialization vector size used to encrypt the user-data-directory. [Read more about how to use it](/features/contexts)." + description: >- + The initialization vector size used to encrypt the + user-data-directory. [Read more about how to use + it](/features/contexts). type: integer format: uint8 required: @@ -115,7 +683,7 @@ paths: - publicKey - cipherAlgorithm - initializationVectorSize - "/v1/contexts/{id}": + /v1/contexts/{id}: get: operationId: Contexts_get summary: Get a Context @@ -126,12 +694,12 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Context" + $ref: '#/components/schemas/Context' put: operationId: Contexts_update summary: Update a Context @@ -142,7 +710,7 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -159,10 +727,16 @@ paths: description: The public key to encrypt the user-data-directory. type: string cipherAlgorithm: - description: The cipher algorithm used to encrypt the user-data-directory. AES-256-CBC is currently the only supported algorithm. + description: >- + The cipher algorithm used to encrypt the + user-data-directory. AES-256-CBC is currently the only + supported algorithm. type: string initializationVectorSize: - description: "The initialization vector size used to encrypt the user-data-directory. [Read more about how to use it](/features/contexts)." + description: >- + The initialization vector size used to encrypt the + user-data-directory. [Read more about how to use + it](/features/contexts). type: integer format: uint8 required: @@ -181,8 +755,10 @@ paths: schema: type: string responses: - "204": - description: "There is no content to send for this request, but the headers may be useful." + '204': + description: >- + There is no content to send for this request, but the headers may be + useful. /v1/downloads: get: operationId: Downloads_list @@ -255,7 +831,7 @@ paths: default: 0 minimum: 0 responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -309,11 +885,13 @@ paths: - total - limit - offset - "/v1/downloads/{id}": + /v1/downloads/{id}: get: operationId: Downloads_get summary: Get a Download - description: "Get download metadata (Accept: application/json) or file content (Accept: application/octet-stream)." + description: >- + Get download metadata (Accept: application/json) or file content + (Accept: application/octet-stream). parameters: - name: id in: path @@ -322,7 +900,7 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -375,7 +953,7 @@ paths: schema: type: string responses: - "204": + '204': description: There is no content to send for this request. /v1/extensions: post: @@ -394,13 +972,13 @@ paths: required: - file responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Extension" - "/v1/extensions/{id}": + $ref: '#/components/schemas/Extension' + /v1/extensions/{id}: get: operationId: Extensions_get summary: Get an Extension @@ -411,12 +989,12 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Extension" + $ref: '#/components/schemas/Extension' delete: operationId: Extensions_delete summary: Delete an Extension @@ -427,13 +1005,15 @@ paths: schema: type: string responses: - "204": - description: "There is no content to send for this request, but the headers may be useful." + '204': + description: >- + There is no content to send for this request, but the headers may be + useful. /v1/fetch: post: operationId: Fetch_create summary: Fetch a Page - description: "Fetch a page and return its content, headers, and metadata." + description: Fetch a page and return its content, headers, and metadata. requestBody: required: true content: @@ -458,7 +1038,11 @@ paths: type: boolean default: false format: - description: Output format for the response content. `raw` (default) returns the response body unchanged; `json` returns structured data (requires `schema`); `markdown` returns the page as markdown. + description: >- + Output format for the response content. `raw` (default) + returns the response body unchanged; `json` returns + structured data (requires `schema`); `markdown` returns the + page as markdown. default: raw anyOf: - type: string @@ -471,13 +1055,15 @@ paths: enum: - markdown schema: - description: JSON Schema describing the desired structure of the response. Only used when `format` is `json`. + description: >- + JSON Schema describing the desired structure of the + response. Only used when `format` is `json`. type: object additionalProperties: {} required: - url responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -500,7 +1086,10 @@ paths: - type: string - type: object additionalProperties: {} - description: The response body content. A string for `raw` and `markdown` formats; a structured object for `json` format (the schema-extracted result). + description: >- + The response body content. A string for `raw` and + `markdown` formats; a structured object for `json` format + (the schema-extracted result). contentType: description: The MIME type of the response type: string @@ -514,8 +1103,10 @@ paths: - content - contentType - encoding - "400": - description: "Invalid request body, or the requested `format` is not supported for the fetched response's content type." + '400': + description: >- + Invalid request body, or the requested `format` is not supported for + the fetched response's content type. content: application/json: schema: @@ -537,19 +1128,23 @@ paths: - statusCode - error - message - "402": + '402': description: Free plan quota exceeded for the requested format. content: application/json: schema: description: Free plan quota exceeded for the requested format. - "403": - description: Project is not enabled for the requested format. Only `raw` is available without enablement. + '403': + description: >- + Project is not enabled for the requested format. Only `raw` is + available without enablement. content: application/json: schema: - description: Project is not enabled for the requested format. Only `raw` is available without enablement. - "429": + description: >- + Project is not enabled for the requested format. Only `raw` is + available without enablement. + '429': description: Concurrent fetch request limit exceeded. content: application/json: @@ -572,8 +1167,10 @@ paths: - statusCode - error - message - "502": - description: The fetched response was too large or TLS certificate verification failed. + '502': + description: >- + The fetched response was too large or TLS certificate verification + failed. content: application/json: schema: @@ -596,7 +1193,7 @@ paths: - error - message - id - "503": + '503': description: The fetch service is temporarily unavailable. content: application/json: @@ -620,7 +1217,7 @@ paths: - error - message - id - "504": + '504': description: The fetch request timed out. content: application/json: @@ -665,7 +1262,7 @@ paths: maximum: 100 minimum: 1 responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -675,7 +1272,7 @@ paths: data: type: array items: - $ref: "#/components/schemas/Function" + $ref: '#/components/schemas/Function' total: type: integer minimum: 0 @@ -708,7 +1305,7 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -718,14 +1315,14 @@ paths: data: type: array items: - $ref: "#/components/schemas/FunctionBuild" + $ref: '#/components/schemas/FunctionBuild' total: type: integer minimum: 0 required: - data - total - "/v1/functions/builds/{id}": + /v1/functions/builds/{id}: get: operationId: FunctionBuilds_get summary: Get a Function Build @@ -737,13 +1334,13 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/FunctionBuild" - "/v1/functions/builds/{id}/logs": + $ref: '#/components/schemas/FunctionBuild' + /v1/functions/builds/{id}/logs: get: operationId: FunctionBuilds_getLogs summary: Get Function Build Logs @@ -755,7 +1352,7 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -765,14 +1362,14 @@ paths: logs: type: array items: - $ref: "#/components/schemas/FunctionBuildLog" + $ref: '#/components/schemas/FunctionBuildLog' total: type: integer minimum: 0 required: - logs - total - "/v1/functions/invocations/{id}": + /v1/functions/invocations/{id}: get: operationId: Invocations_get summary: Get an Invocation @@ -784,13 +1381,13 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: allOf: - - $ref: "#/components/schemas/Invocation" + - $ref: '#/components/schemas/Invocation' - type: object properties: cause: @@ -807,7 +1404,7 @@ paths: minLength: 1 required: - code - "/v1/functions/invocations/{id}/logs": + /v1/functions/invocations/{id}/logs: get: operationId: Invocations_getLogs summary: Get Invocation Logs @@ -819,7 +1416,7 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -829,14 +1426,14 @@ paths: logs: type: array items: - $ref: "#/components/schemas/InvocationLog" + $ref: '#/components/schemas/InvocationLog' total: type: integer minimum: 0 required: - logs - total - "/v1/functions/versions/{id}": + /v1/functions/versions/{id}: get: operationId: FunctionVersions_get summary: Get a Function Version @@ -848,13 +1445,13 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/FunctionVersion" - "/v1/functions/versions/{id}/invocations": + $ref: '#/components/schemas/FunctionVersion' + /v1/functions/versions/{id}/invocations: get: operationId: FunctionVersions_listInvocations summary: List Invocations for a Function Version @@ -886,7 +1483,7 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -896,14 +1493,14 @@ paths: results: type: array items: - $ref: "#/components/schemas/Invocation" + $ref: '#/components/schemas/Invocation' total: type: integer minimum: 0 required: - results - total - "/v1/functions/{id}": + /v1/functions/{id}: get: operationId: Functions_get summary: Get a Function @@ -915,13 +1512,13 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Function" - "/v1/functions/{id}/invoke": + $ref: '#/components/schemas/Function' + /v1/functions/{id}/invoke: post: operationId: Functions_invoke summary: Invoke a Function @@ -947,7 +1544,9 @@ paths: type: object properties: extensionId: - description: "The uploaded Extension ID. See [Upload Extension](/reference/api/upload-an-extension)." + description: >- + The uploaded Extension ID. See [Upload + Extension](/reference/api/upload-an-extension). type: string browserSettings: type: object @@ -959,12 +1558,16 @@ paths: description: The Context ID. type: string persist: - description: Whether or not to persist the context after browsing. Defaults to `false`. + description: >- + Whether or not to persist the context after + browsing. Defaults to `false`. type: boolean required: - id extensionId: - description: "The uploaded Extension ID. See [Upload Extension](/reference/api/upload-an-extension)." + description: >- + The uploaded Extension ID. See [Upload + Extension](/reference/api/upload-an-extension). type: string viewport: type: object @@ -976,16 +1579,24 @@ paths: description: The height of the browser. type: integer blockAds: - description: Enable or disable ad blocking in the browser. Defaults to `false`. + description: >- + Enable or disable ad blocking in the browser. + Defaults to `false`. type: boolean solveCaptchas: - description: Enable or disable captcha solving in the browser. Defaults to `true`. + description: >- + Enable or disable captcha solving in the browser. + Defaults to `true`. type: boolean recordSession: - description: Enable or disable session recording. Defaults to `true`. + description: >- + Enable or disable session recording. Defaults to + `true`. type: boolean logSession: - description: Enable or disable session logging. Defaults to `true`. + description: >- + Enable or disable session logging. Defaults to + `true`. type: boolean advancedStealth: description: Advanced Browser Stealth Mode @@ -994,13 +1605,21 @@ paths: description: Verified Browser Mode type: boolean captchaImageSelector: - description: "Custom selector for captcha image. See [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)" + description: >- + Custom selector for captcha image. See [Custom + Captcha + Solving](/features/stealth-mode#custom-captcha-solving) type: string captchaInputSelector: - description: "Custom selector for captcha input. See [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)" + description: >- + Custom selector for captcha input. See [Custom + Captcha + Solving](/features/stealth-mode#custom-captcha-solving) type: string os: - description: "Operating system for stealth mode. Valid values: windows, mac, linux, mobile, tablet" + description: >- + Operating system for stealth mode. Valid values: + windows, mac, linux, mobile, tablet type: string enum: - windows @@ -1009,7 +1628,7 @@ paths: - mobile - tablet size: - description: "[NOT IN DOCS] Resource size of the browser." + description: '[NOT IN DOCS] Resource size of the browser.' type: string default: small enum: @@ -1017,13 +1636,21 @@ paths: - medium - large enableNativeSelectPolyfill: - description: "[NOT IN DOCS] Enable native select polyfill. This gives support a break-glass option to disable the polyfill." + description: >- + [NOT IN DOCS] Enable native select polyfill. This + gives support a break-glass option to disable the + polyfill. type: boolean enablePdfViewer: - description: "[NOT IN DOCS] Enable PDF viewer. This gives support a break-glass option to enable the viewer when users want to view PDFs in-browser." + description: >- + [NOT IN DOCS] Enable PDF viewer. This gives support + a break-glass option to enable the viewer when users + want to view PDFs in-browser. type: boolean extensions: - description: "[NOT IN DOCS] List of pre-installed extension names and custom extension ids to enable on the browser" + description: >- + [NOT IN DOCS] List of pre-installed extension names + and custom extension ids to enable on the browser type: array items: type: string @@ -1032,23 +1659,39 @@ paths: - browser-events default: [] allowedDomains: - description: "An optional list of allowed domains for the session. If you pass one or more domains, Browserbase restricts top-level (main-frame) page navigations to the listed domains and their subdomains. For example, `example.com` also permits `www.example.com` and `a.b.example.com`, but not `notexample.com`. Matching is domain-based, not full-URL. An empty list (the default) disables the restriction entirely. Browserbase enforces only main-frame navigations; it does not block iframe/subframe loads or other in-page resource requests (images, scripts, XHR, etc.)." + description: >- + An optional list of allowed domains for the session. + If you pass one or more domains, Browserbase + restricts top-level (main-frame) page navigations to + the listed domains and their subdomains. For + example, `example.com` also permits + `www.example.com` and `a.b.example.com`, but not + `notexample.com`. Matching is domain-based, not + full-URL. An empty list (the default) disables the + restriction entirely. Browserbase enforces only + main-frame navigations; it does not block + iframe/subframe loads or other in-page resource + requests (images, scripts, XHR, etc.). type: array items: type: string default: [] ignoreCertificateErrors: - description: Enable or disable ignoring of certificate errors in the browser. Defaults to `true`. + description: >- + Enable or disable ignoring of certificate errors in + the browser. Defaults to `true`. type: boolean proxies: - description: "Proxy configuration. Can be true for default proxy, or an array of proxy configurations." + description: >- + Proxy configuration. Can be true for default proxy, or + an array of proxy configurations. anyOf: - type: array items: anyOf: - - $ref: "#/components/schemas/BrowserbaseProxyConfig" - - $ref: "#/components/schemas/ExternalProxyConfig" - - $ref: "#/components/schemas/NoneProxyConfig" + - $ref: '#/components/schemas/BrowserbaseProxyConfig' + - $ref: '#/components/schemas/ExternalProxyConfig' + - $ref: '#/components/schemas/NoneProxyConfig' - type: boolean proxySettings: description: Supplementary proxy settings. Optional. @@ -1063,24 +1706,31 @@ paths: type: string default: [] userMetadata: - description: "Arbitrary user metadata to attach to the session. To learn more about user metadata, see [User Metadata](/features/sessions#user-metadata)." + description: >- + Arbitrary user metadata to attach to the session. To + learn more about user metadata, see [User + Metadata](/features/sessions#user-metadata). type: object additionalProperties: true properties: {} timeout: - description: Duration in seconds after which the function invocation will automatically end. Defaults to 900 (15 minutes). + description: >- + Duration in seconds after which the function invocation + will automatically end. Defaults to 900 (15 minutes). type: integer default: 900 maximum: 900 minimum: 60 responses: - "202": - description: "The request has been accepted for processing, but processing has not yet completed." + '202': + description: >- + The request has been accepted for processing, but processing has not + yet completed. content: application/json: schema: - $ref: "#/components/schemas/Invocation" - "/v1/functions/{id}/versions": + $ref: '#/components/schemas/Invocation' + /v1/functions/{id}/versions: get: operationId: Functions_listVersions summary: List Function Versions @@ -1107,7 +1757,7 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -1117,7 +1767,7 @@ paths: results: type: array items: - $ref: "#/components/schemas/FunctionVersion" + $ref: '#/components/schemas/FunctionVersion' total: type: integer minimum: 0 @@ -1129,15 +1779,15 @@ paths: operationId: Projects_list summary: List Projects responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: type: array items: - $ref: "#/components/schemas/Project" - "/v1/projects/{id}": + $ref: '#/components/schemas/Project' + /v1/projects/{id}: get: operationId: Projects_get summary: Get a Project @@ -1148,13 +1798,13 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Project" - "/v1/projects/{id}/usage": + $ref: '#/components/schemas/Project' + /v1/projects/{id}/usage: get: operationId: Projects_usage summary: Get Project Usage @@ -1165,12 +1815,12 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/ProjectUsage" + $ref: '#/components/schemas/ProjectUsage' /v1/search: post: operationId: Search_web @@ -1197,7 +1847,7 @@ paths: required: - query responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -1264,19 +1914,22 @@ paths: - COMPLETED - name: q in: query - description: "Query sessions by user metadata. See [Querying Sessions by User Metadata](/features/sessions#querying-sessions-by-user-metadata) for the schema of this query." + description: >- + Query sessions by user metadata. See [Querying Sessions by User + Metadata](/features/sessions#querying-sessions-by-user-metadata) for + the schema of this query. required: false schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: type: array items: - $ref: "#/components/schemas/Session" + $ref: '#/components/schemas/Session' post: operationId: Sessions_create summary: Create a Session @@ -1287,10 +1940,16 @@ paths: type: object properties: projectId: - description: "The Project ID. Can be found in [Settings](https://www.browserbase.com/settings). Optional - if not provided, the project will be inferred from the API key." + description: >- + The Project ID. Can be found in + [Settings](https://www.browserbase.com/settings). Optional - + if not provided, the project will be inferred from the API + key. type: string extensionId: - description: "The uploaded Extension ID. See [Upload Extension](/reference/api/upload-an-extension)." + description: >- + The uploaded Extension ID. See [Upload + Extension](/reference/api/upload-an-extension). type: string browserSettings: type: object @@ -1302,12 +1961,16 @@ paths: description: The Context ID. type: string persist: - description: Whether or not to persist the context after browsing. Defaults to `false`. + description: >- + Whether or not to persist the context after + browsing. Defaults to `false`. type: boolean required: - id extensionId: - description: "The uploaded Extension ID. See [Upload Extension](/reference/api/upload-an-extension)." + description: >- + The uploaded Extension ID. See [Upload + Extension](/reference/api/upload-an-extension). type: string viewport: type: object @@ -1319,10 +1982,14 @@ paths: description: The height of the browser. type: integer blockAds: - description: Enable or disable ad blocking in the browser. Defaults to `false`. + description: >- + Enable or disable ad blocking in the browser. Defaults + to `false`. type: boolean solveCaptchas: - description: Enable or disable captcha solving in the browser. Defaults to `true`. + description: >- + Enable or disable captcha solving in the browser. + Defaults to `true`. type: boolean recordSession: description: Enable or disable session recording. Defaults to `true`. @@ -1337,13 +2004,19 @@ paths: description: Verified Browser Mode type: boolean captchaImageSelector: - description: "Custom selector for captcha image. See [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)" + description: >- + Custom selector for captcha image. See [Custom Captcha + Solving](/features/stealth-mode#custom-captcha-solving) type: string captchaInputSelector: - description: "Custom selector for captcha input. See [Custom Captcha Solving](/features/stealth-mode#custom-captcha-solving)" + description: >- + Custom selector for captcha input. See [Custom Captcha + Solving](/features/stealth-mode#custom-captcha-solving) type: string os: - description: "Operating system for stealth mode. Valid values: windows, mac, linux, mobile, tablet" + description: >- + Operating system for stealth mode. Valid values: + windows, mac, linux, mobile, tablet type: string enum: - windows @@ -1352,31 +2025,51 @@ paths: - mobile - tablet allowedDomains: - description: "An optional list of allowed domains for the session. If you pass one or more domains, Browserbase restricts top-level (main-frame) page navigations to the listed domains and their subdomains. For example, `example.com` also permits `www.example.com` and `a.b.example.com`, but not `notexample.com`. Matching is domain-based, not full-URL. An empty list (the default) disables the restriction entirely. Browserbase enforces only main-frame navigations; it does not block iframe/subframe loads or other in-page resource requests (images, scripts, XHR, etc.)." + description: >- + An optional list of allowed domains for the session. If + you pass one or more domains, Browserbase restricts + top-level (main-frame) page navigations to the listed + domains and their subdomains. For example, `example.com` + also permits `www.example.com` and `a.b.example.com`, + but not `notexample.com`. Matching is domain-based, not + full-URL. An empty list (the default) disables the + restriction entirely. Browserbase enforces only + main-frame navigations; it does not block + iframe/subframe loads or other in-page resource requests + (images, scripts, XHR, etc.). type: array items: type: string default: [] ignoreCertificateErrors: - description: Enable or disable ignoring of certificate errors in the browser. Defaults to `true`. + description: >- + Enable or disable ignoring of certificate errors in the + browser. Defaults to `true`. type: boolean timeout: - description: Duration in seconds after which the session will automatically end. Defaults to the Project's `defaultTimeout`. + description: >- + Duration in seconds after which the session will + automatically end. Defaults to the Project's + `defaultTimeout`. type: integer maximum: 21600 minimum: 60 keepAlive: - description: Set to true to keep the session alive even after disconnections. Available on the Hobby Plan and above. + description: >- + Set to true to keep the session alive even after + disconnections. Available on the Hobby Plan and above. type: boolean proxies: - description: "Proxy configuration. Can be true for default proxy, or an array of proxy configurations." + description: >- + Proxy configuration. Can be true for default proxy, or an + array of proxy configurations. anyOf: - type: array items: anyOf: - - $ref: "#/components/schemas/BrowserbaseProxyConfig" - - $ref: "#/components/schemas/ExternalProxyConfig" - - $ref: "#/components/schemas/NoneProxyConfig" + - $ref: '#/components/schemas/BrowserbaseProxyConfig' + - $ref: '#/components/schemas/ExternalProxyConfig' + - $ref: '#/components/schemas/NoneProxyConfig' - type: boolean proxySettings: description: Supplementary proxy settings. Optional. @@ -1400,18 +2093,23 @@ paths: - eu-central-1 - ap-southeast-1 userMetadata: - description: "Arbitrary user metadata to attach to the session. To learn more about user metadata, see [User Metadata](/features/sessions#user-metadata)." + description: >- + Arbitrary user metadata to attach to the session. To learn + more about user metadata, see [User + Metadata](/features/sessions#user-metadata). type: object additionalProperties: true properties: {} responses: - "201": - description: The request has succeeded and a new resource has been created as a result. + '201': + description: >- + The request has succeeded and a new resource has been created as a + result. content: application/json: schema: allOf: - - $ref: "#/components/schemas/Session" + - $ref: '#/components/schemas/Session' - type: object properties: connectUrl: @@ -1423,7 +2121,9 @@ paths: type: string format: uri signingKey: - description: Signing key to use when connecting to the Session via HTTP. + description: >- + Signing key to use when connecting to the Session via + HTTP. type: string required: - connectUrl @@ -1448,10 +2148,13 @@ paths: body: JSON.stringify({}) }) - lang: Python - source: |- + source: >- import requests + url = "https://api.browserbase.com/v1/sessions" + payload = {} + headers = { @@ -1459,7 +2162,10 @@ paths: "X-BB-API-Key": "", "Content-Type": "application/json" } - response = requests.request("POST", url, json=payload, headers=headers) + + response = requests.request("POST", url, json=payload, + headers=headers) + print(response.text) - lang: PHP source: |- @@ -1490,8 +2196,9 @@ paths: - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.browserbase.com/v1/sessions\"\n\n\tpayload := strings.NewReader(\"{}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\n\treq.Header.Add(\"X-BB-API-Key\", \"\")\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Java - source: |- - HttpResponse response = Unirest.post("https://api.browserbase.com/v1/sessions") + source: >- + HttpResponse response = + Unirest.post("https://api.browserbase.com/v1/sessions") @@ -1499,7 +2206,7 @@ paths: .header("Content-Type", "application/json") .body("{}") .asString(); - "/v1/sessions/{id}": + /v1/sessions/{id}: get: operationId: Sessions_get summary: Get a Session @@ -1510,13 +2217,13 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: allOf: - - $ref: "#/components/schemas/Session" + - $ref: '#/components/schemas/Session' - type: object properties: connectUrl: @@ -1528,7 +2235,9 @@ paths: type: string format: uri signingKey: - description: Signing key to use when connecting to the Session via HTTP. + description: >- + Signing key to use when connecting to the Session via + HTTP. type: string post: operationId: Sessions_update @@ -1547,20 +2256,23 @@ paths: type: object properties: status: - description: Set to `REQUEST_RELEASE` to request that the session complete. Use before session's timeout to avoid additional charges. + description: >- + Set to `REQUEST_RELEASE` to request that the session + complete. Use before session's timeout to avoid additional + charges. type: string enum: - REQUEST_RELEASE required: - status responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/Session" - "/v1/sessions/{id}/debug": + $ref: '#/components/schemas/Session' + /v1/sessions/{id}/debug: get: operationId: Sessions_getDebug summary: Session Live URLs @@ -1571,13 +2283,13 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: - $ref: "#/components/schemas/SessionLiveUrls" - "/v1/sessions/{id}/logs": + $ref: '#/components/schemas/SessionLiveUrls' + /v1/sessions/{id}/logs: get: operationId: Sessions_getLogs summary: Session Logs @@ -1588,15 +2300,15 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: type: array items: - $ref: "#/components/schemas/SessionLog" - "/v1/sessions/{id}/recording": + $ref: '#/components/schemas/SessionLog' + /v1/sessions/{id}/recording: get: operationId: Sessions_getRecording summary: Session Recording @@ -1607,19 +2319,21 @@ paths: schema: type: string responses: - "200": + '200': description: The request has succeeded. content: application/json: schema: type: array items: - $ref: "#/components/schemas/SessionRecording" - "/v1/sessions/{id}/replays": + $ref: '#/components/schemas/SessionRecording' + /v1/sessions/{id}/replays: get: operationId: Sessions_getReplay summary: Get Session Replay - description: "Returns page metadata for a session replay, including timing information and the URL of each page's HLS playlist." + description: >- + Returns page metadata for a session replay, including timing information + and the URL of each page's HLS playlist. parameters: - name: id in: path @@ -1629,7 +2343,7 @@ paths: type: string format: uuid responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -1639,17 +2353,19 @@ paths: pages: type: array items: - $ref: "#/components/schemas/ReplayPage" + $ref: '#/components/schemas/ReplayPage' pageCount: type: integer required: - pages - pageCount - "/v1/sessions/{id}/replays/{pageId}": + /v1/sessions/{id}/replays/{pageId}: get: operationId: Sessions_getReplayPage summary: Get Replay Page - description: Returns an HLS VOD media playlist (.m3u8) for a specific page of a session replay. + description: >- + Returns an HLS VOD media playlist (.m3u8) for a specific page of a + session replay. parameters: - name: id in: path @@ -1666,13 +2382,13 @@ paths: maxLength: 3 pattern: ^\d+$ responses: - "200": + '200': description: The request has succeeded. content: application/vnd.apple.mpegurl: schema: type: string - "/v1/sessions/{id}/uploads": + /v1/sessions/{id}/uploads: post: operationId: Sessions_uploadFile summary: Create Session Uploads @@ -1695,7 +2411,7 @@ paths: required: - file responses: - "200": + '200': description: The request has succeeded. content: application/json: @@ -1708,11 +2424,139 @@ paths: - message components: schemas: + Agent: + description: >- + A reusable agent. Referenced by `agentId` to apply a system prompt to + every run that uses the agent. + type: object + properties: + agentId: + description: >- + Unique identifier for the agent. Use this value as `agentId` when + creating an agent run. + type: string + name: + description: >- + Human-readable name for the agent. Used to identify the agent in the + dashboard and API responses. + type: string + systemPrompt: + description: System prompt applied to every run that uses this agent. + type: string + resultSchema: + description: >- + [JSON Schema](https://json-schema.org/specification) that runs + referencing this agent will aim to conform their `result` to. Can be + overridden per run by passing `resultSchema` on the run request. + type: object + additionalProperties: true + properties: {} + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + required: + - agentId + - name + - createdAt + - updatedAt + AgentRun: + description: >- + One execution of an agent against a task. Created in `pending` and + transitioned through `running` → `completed`/`failed` by the runner. + type: object + properties: + runId: + description: Unique identifier for the run. + type: string + agentId: + description: >- + The ID of the agent applied to this run, if any. Omitted for ad-hoc + runs. + type: string + task: + description: The original task description. + type: string + status: + description: |- + Current status of the run. + - `PENDING` - agent will run soon + - `RUNNING` - agent is currently running + - `COMPLETED` - agent has finished running + - `FAILED` - agent has failed the run + - `STOPPED` - run was stopped by the user + - `TIMED_OUT` - run exceeded maximum time + type: string + enum: + - PENDING + - RUNNING + - COMPLETED + - FAILED + - STOPPED + - TIMED_OUT + sessionId: + description: The Browserbase session ID powering this run. + type: string + sandboxId: + description: External sandbox identifier assigned by the runner. Optional. + type: string + resultSchema: + description: >- + Per-run [JSON Schema](https://json-schema.org/specification) + override for the result shape. When unset, the agent's default + `resultSchema` applies. + type: object + additionalProperties: true + properties: {} + result: + description: >- + The agent's structured result for the run. Only present when the run + has finished and output is available. The result conforms to the + provided [JSON Schema](https://json-schema.org/specification) when + one is set. + type: object + additionalProperties: true + properties: {} + cause: + type: object + properties: + code: + description: Structured failure code (e.g., RUNNER_HEARTBEAT_LOST). + type: string + maxLength: 64 + message: + description: Human-readable failure detail. + type: string + maxLength: 500 + required: + - code + startedAt: + type: string + format: date-time + endedAt: + type: string + format: date-time + createdAt: + type: string + format: date-time + updatedAt: + type: string + format: date-time + required: + - runId + - task + - status + - createdAt + - updatedAt BrowserbaseProxyConfig: type: object properties: type: - description: Type of proxy. Always use 'browserbase' for the Browserbase managed proxy network. + description: >- + Type of proxy. Always use 'browserbase' for the Browserbase managed + proxy network. type: string enum: - browserbase @@ -1721,10 +2565,14 @@ components: type: object properties: city: - description: Name of the city. Use spaces for multi-word city names. Optional. + description: >- + Name of the city. Use spaces for multi-word city names. + Optional. type: string state: - description: US state code (2 characters). Must also specify US as the country. Optional. + description: >- + US state code (2 characters). Must also specify US as the + country. Optional. type: string maxLength: 2 minLength: 2 @@ -1736,7 +2584,9 @@ components: required: - country domainPattern: - description: "Domain pattern for which this proxy should be used. If omitted, defaults to all domains. Optional." + description: >- + Domain pattern for which this proxy should be used. If omitted, + defaults to all domains. Optional. type: string required: - type @@ -1813,7 +2663,9 @@ components: description: Server URL for external proxy. Required. type: string domainPattern: - description: "Domain pattern for which this proxy should be used. If omitted, defaults to all domains. Optional." + description: >- + Domain pattern for which this proxy should be used. If omitted, + defaults to all domains. Optional. type: string username: description: Username for external proxy authentication. Optional. @@ -1896,11 +2748,11 @@ components: type: array items: allOf: - - $ref: "#/components/schemas/Function" + - $ref: '#/components/schemas/Function' - type: object properties: createdVersion: - $ref: "#/components/schemas/FunctionVersion" + $ref: '#/components/schemas/FunctionVersion' required: - createdVersion cause: @@ -2066,7 +2918,9 @@ components: enum: - none domainPattern: - description: "Domain pattern for which this proxy should be used. If omitted, defaults to all domains. Optional." + description: >- + Domain pattern for which this proxy should be used. If omitted, + defaults to all domains. Optional. type: string required: - type @@ -2091,7 +2945,9 @@ components: maximum: 21600 minimum: 60 concurrency: - description: The maximum number of sessions that this project can run concurrently. + description: >- + The maximum number of sessions that this project can run + concurrently. type: integer minimum: 1 required: @@ -2162,10 +3018,14 @@ components: - TIMED_OUT - COMPLETED proxyBytes: - description: "Bytes used via the [Proxy](/features/stealth-mode#proxies-and-residential-ips)" + description: >- + Bytes used via the + [Proxy](/features/stealth-mode#proxies-and-residential-ips) type: integer keepAlive: - description: Indicates if the Session was created to be kept alive upon disconnections + description: >- + Indicates if the Session was created to be kept alive upon + disconnections type: boolean contextId: description: Optional. The Context linked to the Session. @@ -2179,7 +3039,10 @@ components: - eu-central-1 - ap-southeast-1 userMetadata: - description: "Arbitrary user metadata to attach to the session. To learn more about user metadata, see [User Metadata](/features/sessions#user-metadata)." + description: >- + Arbitrary user metadata to attach to the session. To learn more + about user metadata, see [User + Metadata](/features/sessions#user-metadata). type: object additionalProperties: true properties: {} @@ -2293,7 +3156,9 @@ components: type: object properties: data: - description: "See [rrweb documentation](https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/dive-into-event.md)." + description: >- + See [rrweb + documentation](https://github.com/rrweb-io/rrweb/blob/master/docs/recipes/dive-into-event.md). type: object additionalProperties: true properties: {} @@ -2314,7 +3179,7 @@ components: type: apiKey in: header name: X-BB-API-Key - description: "Your [Browserbase API Key](https://www.browserbase.com/settings)." + description: Your [Browserbase API Key](https://www.browserbase.com/settings). tags: [] security: - BrowserbaseAuth: []