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
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace DeepInfra.CLI.Commands;

internal static partial class AccountAccountEmailValuesCommandApiCommand
{
private static Option<string?> XiApiKey { get; } = new(
name: @"--xi-api-key")
{
Description = @"",
};

private static Option<string?> XApiKey { get; } = new(
name: @"--x-api-key")
{
Description = @"",
};

private static string FormatResponse(ParseResult parseResult, global::DeepInfra.EmailsOut 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, global::DeepInfra.EmailsOut value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"email-values", @"Account Email Values");
command.Options.Add(XiApiKey);
command.Options.Add(XApiKey);


command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{
var xiApiKey = parseResult.GetValue(XiApiKey);
var xApiKey = parseResult.GetValue(XApiKey);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Account.AccountEmailValuesAsync(
xiApiKey: xiApiKey,
xApiKey: xApiKey,
cancellationToken: cancellationToken).ConfigureAwait(false);


if (!await CliRuntime.TryWriteOutputDirectoryAsync(
parseResult,
response,
global::DeepInfra.SourceGenerationContext.Default,
@"Emails",
cancellationToken).ConfigureAwait(false))
{
await CliRuntime.WriteResponseAsync(
parseResult,
response,
global::DeepInfra.SourceGenerationContext.Default,
FormatResponse,
cancellationToken).ConfigureAwait(false);
}
}, cancellationToken).ConfigureAwait(false));
return command;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#nullable enable
#pragma warning disable CS0618

using System.CommandLine;

namespace DeepInfra.CLI.Commands;

internal static partial class AccountAccountGpuLimitCommandApiCommand
{
private static Option<string?> XiApiKey { get; } = new(
name: @"--xi-api-key")
{
Description = @"",
};

private static Option<string?> XApiKey { get; } = new(
name: @"--x-api-key")
{
Description = @"",
};

private static string FormatResponse(ParseResult parseResult, global::DeepInfra.GpuLimitOut 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, global::DeepInfra.GpuLimitOut value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"gpu-limit", @"Account Gpu Limit");
command.Options.Add(XiApiKey);
command.Options.Add(XApiKey);


command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{
var xiApiKey = parseResult.GetValue(XiApiKey);
var xApiKey = parseResult.GetValue(XApiKey);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Account.AccountGpuLimitAsync(
xiApiKey: xiApiKey,
xApiKey: xApiKey,
cancellationToken: cancellationToken).ConfigureAwait(false);


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

using System.CommandLine;

namespace DeepInfra.CLI.Commands;

internal static partial class AccountAccountRateLimitCommandApiCommand
{
private static Option<string?> XiApiKey { get; } = new(
name: @"--xi-api-key")
{
Description = @"",
};

private static Option<string?> XApiKey { get; } = new(
name: @"--x-api-key")
{
Description = @"",
};

private static string FormatResponse(ParseResult parseResult, global::DeepInfra.RateLimitOut 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, global::DeepInfra.RateLimitOut value, ref string? text);
static partial void CustomizeResponseFormatHints(Dictionary<string, CliFormatHint> hints);


public static Command Create()
{
var command = new Command(@"rate-limit", @"Account Rate Limit");
command.Options.Add(XiApiKey);
command.Options.Add(XApiKey);


command.SetAction(async (ParseResult parseResult, CancellationToken cancellationToken) =>
await CliRuntime.RunAsync(async () =>
{
var xiApiKey = parseResult.GetValue(XiApiKey);
var xApiKey = parseResult.GetValue(XApiKey);
using var client = await CliRuntime.CreateClientAsync(parseResult, cancellationToken).ConfigureAwait(false);


var response = await client.Account.AccountRateLimitAsync(
xiApiKey: xiApiKey,
xApiKey: xApiKey,
cancellationToken: cancellationToken).ConfigureAwait(false);


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