Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 45 additions & 0 deletions src/cli/AI21.CLI/Commands/AgentCreateOptionSet.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#nullable enable

using System.CommandLine;

namespace AI21.CLI.Commands;

internal sealed record AgentCreateOptionSet(
Option<string> AgentId,
Option<string?> Kind,
Option<string?> NameOption,
Option<string?> DescriptionOption,
Option<string?> ConfigId,
Option<bool?> Enabled)
{
public static AgentCreateOptionSet Create(string? prefix = null)
{
var normalizedPrefix = string.IsNullOrWhiteSpace(prefix)
? string.Empty
: prefix.Trim().Trim('-') + "-";
return new AgentCreateOptionSet(
AgentId: new Option<string>($"--{normalizedPrefix}agent-id")
{
Description = @"",
Required = true,
},
Kind: new Option<string?>($"--{normalizedPrefix}kind")
{
Description = @"",
},
NameOption: new Option<string?>($"--{normalizedPrefix}name")
{
Description = @"",
},
DescriptionOption: new Option<string?>($"--{normalizedPrefix}description")
{
Description = @"",
},
ConfigId: new Option<string?>($"--{normalizedPrefix}config-id")
{
Description = @"",
},
Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"")
);
}
}
39 changes: 39 additions & 0 deletions src/cli/AI21.CLI/Commands/AgentUpdateOptionSet.g.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#nullable enable

using System.CommandLine;

namespace AI21.CLI.Commands;

internal sealed record AgentUpdateOptionSet(
Option<string?> NameOption,
Option<string?> Kind,
Option<string?> DescriptionOption,
Option<string?> ConfigId,
Option<bool?> Enabled)
{
public static AgentUpdateOptionSet Create(string? prefix = null)
{
var normalizedPrefix = string.IsNullOrWhiteSpace(prefix)
? string.Empty
: prefix.Trim().Trim('-') + "-";
return new AgentUpdateOptionSet(
NameOption: new Option<string?>($"--{normalizedPrefix}name")
{
Description = @"",
},
Kind: new Option<string?>($"--{normalizedPrefix}kind")
{
Description = @"",
},
DescriptionOption: new Option<string?>($"--{normalizedPrefix}description")
{
Description = @"",
},
ConfigId: new Option<string?>($"--{normalizedPrefix}config-id")
{
Description = @"",
},
Enabled: CliRuntime.CreateNullableBoolOption(name: $"--{normalizedPrefix}enabled", description: @"")
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace AI21.CLI.Commands;

internal static partial class AnalyticsAgentsGatewayAnalyticsV1AgentsGetCommandApiCommand
{


private static string FormatResponse(ParseResult parseResult, string 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<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"analytics-agents-gateway-analytics-v1-agents-get", @"Analytics Agents");



command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.AnalyticsAgentsGatewayAnalyticsV1AgentsGetAsync(

cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::AI21.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace AI21.CLI.Commands;

internal static partial class AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetCommandApiCommand
{


private static string FormatResponse(ParseResult parseResult, string 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<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"analytics-agents-tokenwise-analytics-v1-agents-get", @"Analytics Agents");



command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.AnalyticsAgentsTokenwiseAnalyticsV1AgentsGetAsync(

cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::AI21.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace AI21.CLI.Commands;

internal static partial class AnalyticsContextBashGatewayAnalyticsV1ContextBashGetCommandApiCommand
{


private static string FormatResponse(ParseResult parseResult, string 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<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"analytics-context-bash-gateway-analytics-v1-context-bash-get", @"Analytics Context Bash");



command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.AnalyticsContextBashGatewayAnalyticsV1ContextBashGetAsync(

cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::AI21.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace AI21.CLI.Commands;

internal static partial class AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetCommandApiCommand
{


private static string FormatResponse(ParseResult parseResult, string 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<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"analytics-context-bash-tokenwise-analytics-v1-context-bash-get", @"Analytics Context Bash");



command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.AnalyticsContextBashTokenwiseAnalyticsV1ContextBashGetAsync(

cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::AI21.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace AI21.CLI.Commands;

internal static partial class AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetCommandApiCommand
{


private static string FormatResponse(ParseResult parseResult, string 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<string, CliFormatHint>(StringComparer.OrdinalIgnoreCase)
{
};
CustomizeResponseFormatHints(hints);
return CliRuntime.FormatHumanReadable(value, context, truncateLongStrings, hints);
}

static partial void CustomizeResponseText(ParseResult parseResult, string value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"analytics-context-blocks-gateway-analytics-v1-context-blocks-get", @"Analytics Context Blocks");



command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{

using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.AnalyticsContextBlocksGatewayAnalyticsV1ContextBlocksGetAsync(

cancellationToken: cancellationToken).ConfigureAwait(false);


await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::AI21.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Loading