mirror of
https://github.com/Tribufu/TribufuDotNet
synced 2026-08-08 20:31:06 +00:00
Generate client with open-api-generator (#1)
* Generate project with open-api-generator * Add example project * Create wrapper class
This commit is contained in:
parent
311678cfd6
commit
d791408793
87 changed files with 24687 additions and 6126 deletions
31
src/Tribufu.Example/Program.cs
Normal file
31
src/Tribufu.Example/Program.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (c) Tribufu. All Rights Reserved.
|
||||
// SPDX-License-Identifier: UNLICENSED
|
||||
|
||||
using dotenv.net;
|
||||
using Tribufu.Generated.Client;
|
||||
|
||||
namespace Tribufu.Test
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static async Task Main(string[] args)
|
||||
{
|
||||
DotEnv.Load(new DotEnvOptions(ignoreExceptions: true, envFilePaths: [".env", "../../.env"]));
|
||||
|
||||
var apiKey = Environment.GetEnvironmentVariable("TRIBUFU_API_KEY");
|
||||
var tribufu = new TribufuApi(apiKey ?? "");
|
||||
|
||||
Console.WriteLine(TribufuApi.GetVersion());
|
||||
|
||||
try
|
||||
{
|
||||
var result = await tribufu.GetUserInfoAsync();
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
Console.WriteLine(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue