mirror of
https://github.com/tribufu/tribufu-dotnet
synced 2026-02-04 18:59:06 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 117d8b5ab6 | |||
| 6ebfde013a | |||
| 9ff743097b | |||
| 42e14fc07b | |||
| ed2dfa2b8f | |||
| 1815ca6bcd | |||
| 8994fc13d6 | |||
| 549e7bcbe3 | |||
| aede8c7ac2 | |||
| d791408793 | |||
| 311678cfd6 | |||
| 269b07ee4e |
2
.env.example
Normal file
2
.env.example
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
TRIBUFU_API_KEY=""
|
||||||
|
TRIBUFU_API_URL="https://api.tribufu.com"
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -2,6 +2,8 @@
|
|||||||
bin/
|
bin/
|
||||||
obj/
|
obj/
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
.env
|
||||||
*.filters
|
*.filters
|
||||||
*.user
|
*.user
|
||||||
.DS_Store
|
desktop.ini
|
||||||
|
|||||||
9
.openapi-generator-ignore
Normal file
9
.openapi-generator-ignore
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
docs/
|
||||||
|
|
||||||
|
.gitignore
|
||||||
|
*.sln
|
||||||
|
**.csproj
|
||||||
|
api/openapi.yaml
|
||||||
|
appveyor.yml
|
||||||
|
git_push.sh
|
||||||
|
README.md
|
||||||
60
.openapi-generator/FILES
Normal file
60
.openapi-generator/FILES
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
src/Tribufu.Generated/Api/TribufuGeneratedApi.cs
|
||||||
|
src/Tribufu.Generated/Client/ApiClient.cs
|
||||||
|
src/Tribufu.Generated/Client/ApiException.cs
|
||||||
|
src/Tribufu.Generated/Client/ApiResponse.cs
|
||||||
|
src/Tribufu.Generated/Client/ClientUtils.cs
|
||||||
|
src/Tribufu.Generated/Client/Configuration.cs
|
||||||
|
src/Tribufu.Generated/Client/ExceptionFactory.cs
|
||||||
|
src/Tribufu.Generated/Client/GlobalConfiguration.cs
|
||||||
|
src/Tribufu.Generated/Client/HttpMethod.cs
|
||||||
|
src/Tribufu.Generated/Client/IApiAccessor.cs
|
||||||
|
src/Tribufu.Generated/Client/IAsynchronousClient.cs
|
||||||
|
src/Tribufu.Generated/Client/IReadableConfiguration.cs
|
||||||
|
src/Tribufu.Generated/Client/ISynchronousClient.cs
|
||||||
|
src/Tribufu.Generated/Client/Multimap.cs
|
||||||
|
src/Tribufu.Generated/Client/OpenAPIDateConverter.cs
|
||||||
|
src/Tribufu.Generated/Client/RequestOptions.cs
|
||||||
|
src/Tribufu.Generated/Client/RetryConfiguration.cs
|
||||||
|
src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs
|
||||||
|
src/Tribufu.Generated/Model/Account.cs
|
||||||
|
src/Tribufu.Generated/Model/Application.cs
|
||||||
|
src/Tribufu.Generated/Model/ApplicationType.cs
|
||||||
|
src/Tribufu.Generated/Model/AuthorizeRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/CodeChallengeMethod.cs
|
||||||
|
src/Tribufu.Generated/Model/CryptoViewModel.cs
|
||||||
|
src/Tribufu.Generated/Model/Game.cs
|
||||||
|
src/Tribufu.Generated/Model/GameServer.cs
|
||||||
|
src/Tribufu.Generated/Model/GameServerCluster.cs
|
||||||
|
src/Tribufu.Generated/Model/GrantType.cs
|
||||||
|
src/Tribufu.Generated/Model/Group.cs
|
||||||
|
src/Tribufu.Generated/Model/GroupGame.cs
|
||||||
|
src/Tribufu.Generated/Model/GroupMember.cs
|
||||||
|
src/Tribufu.Generated/Model/GroupRank.cs
|
||||||
|
src/Tribufu.Generated/Model/HashViewModel.cs
|
||||||
|
src/Tribufu.Generated/Model/IntrospectRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/IpAddress.cs
|
||||||
|
src/Tribufu.Generated/Model/LeaderboardItem.cs
|
||||||
|
src/Tribufu.Generated/Model/LeaderboardOrder.cs
|
||||||
|
src/Tribufu.Generated/Model/LoginProvider.cs
|
||||||
|
src/Tribufu.Generated/Model/LoginRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/LoginResponse.cs
|
||||||
|
src/Tribufu.Generated/Model/Package.cs
|
||||||
|
src/Tribufu.Generated/Model/Profile.cs
|
||||||
|
src/Tribufu.Generated/Model/ProfileGame.cs
|
||||||
|
src/Tribufu.Generated/Model/ProfileGroup.cs
|
||||||
|
src/Tribufu.Generated/Model/RefreshRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/RegisterRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/ResponseType.cs
|
||||||
|
src/Tribufu.Generated/Model/RevokeRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/SearchRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/SearchType.cs
|
||||||
|
src/Tribufu.Generated/Model/ServerMetrics.cs
|
||||||
|
src/Tribufu.Generated/Model/ServerStatus.cs
|
||||||
|
src/Tribufu.Generated/Model/Subscription.cs
|
||||||
|
src/Tribufu.Generated/Model/TokenHintType.cs
|
||||||
|
src/Tribufu.Generated/Model/TokenRequest.cs
|
||||||
|
src/Tribufu.Generated/Model/TokenResponse.cs
|
||||||
|
src/Tribufu.Generated/Model/TokenType.cs
|
||||||
|
src/Tribufu.Generated/Model/UpdateProfile.cs
|
||||||
|
src/Tribufu.Generated/Model/UserInfo.cs
|
||||||
|
src/Tribufu.Generated/Model/UserType.cs
|
||||||
1
.openapi-generator/VERSION
Normal file
1
.openapi-generator/VERSION
Normal file
@@ -0,0 +1 @@
|
|||||||
|
7.12.0
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
|
||||||
<Authors>Tribufu</Authors>
|
<Authors>Tribufu</Authors>
|
||||||
<Company>Tribufu</Company>
|
<Company>Tribufu</Company>
|
||||||
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
|
<Copyright>Copyright (c) Tribufu. All Rights Reserved.</Copyright>
|
||||||
<FileVersion>1.0.0.0</FileVersion>
|
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://github.com/Tribufu/TribufuNet</RepositoryUrl>
|
<RepositoryUrl>https://github.com/tribufu/tribufu-dotnet</RepositoryUrl>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.1.0</Version>
|
||||||
|
<AssemblyVersion>$(Version).0</AssemblyVersion>
|
||||||
|
<NoWarn>$(NoWarn);0618;1591;1998;2002;8767</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -3,8 +3,11 @@
|
|||||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageVersion Include="dotenv.net" Version="3.2.0" />
|
||||||
|
<PackageVersion Include="JsonSubTypes" Version="2.0.1" />
|
||||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
|
<PackageVersion Include="Polly" Version="8.1.0" />
|
||||||
|
<PackageVersion Include="RestSharp" Version="112.1.0" />
|
||||||
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
|
||||||
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
.NET SDK to access Tribufu APIs and services.
|
.NET SDK to access Tribufu APIs and services.
|
||||||
|
|
||||||
|
[![nuget][nuget-badge]][nuget-url]
|
||||||
[![MIT License][mit-badge]][mit-url]
|
[![MIT License][mit-badge]][mit-url]
|
||||||
[![Discord Chat][discord-badge]][discord-url]
|
[![Discord Chat][discord-badge]][discord-url]
|
||||||
|
|
||||||
|
[nuget-badge]: https://img.shields.io/nuget/v/tribufu.svg
|
||||||
|
[nuget-url]: https://www.nuget.org/packages/Tribufu
|
||||||
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
|
||||||
[mit-url]: https://github.com/tribufu/sdk-dotnet/blob/main/LICENSE.txt
|
[mit-url]: https://github.com/tribufu/tribufu-dotnet/blob/main/LICENSE.txt
|
||||||
[discord-badge]: https://img.shields.io/discord/276504514616623104.svg?logo=discord&style=flat-square
|
[discord-badge]: https://img.shields.io/discord/276504514616623104.svg?logo=discord&style=flat-square
|
||||||
[discord-url]: https://www.tribufu.com/discord
|
[discord-url]: https://www.tribufu.com/discord
|
||||||
|
|
||||||
@@ -17,4 +20,4 @@
|
|||||||
|
|
||||||
This project is licensed under the [MIT License].
|
This project is licensed under the [MIT License].
|
||||||
|
|
||||||
[MIT License]: https://github.com/tribufu/sdk-dotnet/blob/main/LICENSE.txt
|
[MIT License]: https://github.com/tribufu/tribufu-dotnet/blob/main/LICENSE.txt
|
||||||
|
|||||||
85
Tribufu.sln
85
Tribufu.sln
@@ -1,50 +1,79 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 16
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Native", "src\Tribufu.Native\Tribufu.Native.csproj", "{C66D6B57-324D-EAF2-3B65-75C9A7C35054}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization", "src\Tribufu.Serialization\Tribufu.Serialization.csproj", "{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Serialization.Newtonsoft", "src\Tribufu.Serialization.Newtonsoft\Tribufu.Serialization.Newtonsoft.csproj", "{B7019B7B-A352-86BD-CCB6-747FB8661927}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu", "src\Tribufu\Tribufu.csproj", "{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu", "src\Tribufu\Tribufu.csproj", "{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Utils", "src\Tribufu.Utils\Tribufu.Utils.csproj", "{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Generated", "src\Tribufu.Generated\Tribufu.Generated.csproj", "{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.ComponentModel", "src\Tribufu.ComponentModel\Tribufu.ComponentModel.csproj", "{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.Example", "src\Tribufu.Example\Tribufu.Example.csproj", "{D6392A29-E2DC-4050-B4C1-B279DD2D226D}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tribufu.SafeCheck", "src\Tribufu.SafeCheck\Tribufu.SafeCheck.csproj", "{B1463692-23C0-435B-A018-B6ED8F305E8D}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{C66D6B57-324D-EAF2-3B65-75C9A7C35054}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{322FE36B-9E9B-9E66-678F-36C4D3BAC0CE}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{B7019B7B-A352-86BD-CCB6-747FB8661927}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{8F16FBBB-199E-4EE3-BFF3-31DD6F84DCD0}.Release|Any CPU.Build.0 = Release|Any CPU
|
{7B7890D8-863A-4F1D-98C0-4B7D8C46CB52}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
{3DFBC35E-62A7-4CB0-81D9-5E7AA1882557}.Release|Any CPU.Build.0 = Release|Any CPU
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{FF9B3170-0FD8-44A5-B6E3-01A8D11D2BEF}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{D6392A29-E2DC-4050-B4C1-B279DD2D226D}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{B1463692-23C0-435B-A018-B6ED8F305E8D} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|||||||
12
scripts/generate.ps1
Normal file
12
scripts/generate.ps1
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env pwsh
|
||||||
|
|
||||||
|
$env:CSHARP_POST_PROCESS_FILE = ""
|
||||||
|
|
||||||
|
java -jar ./vendor/openapi-generator/openapi-generator-cli.jar generate `
|
||||||
|
-i https://api.tribufu.com/openapi.json `
|
||||||
|
-g csharp `
|
||||||
|
-o . `
|
||||||
|
--global-property apis,models,supportingFiles,apiDocs=false,modelDocs=false,apiTests=false,modelTests=false `
|
||||||
|
--additional-properties=packageName=Tribufu.Generated,library=restsharp,zeroBasedEnums=true,nullableReferenceTypes=true `
|
||||||
|
--openapi-normalizer SET_TAGS_FOR_ALL_OPERATIONS=TribufuGenerated `
|
||||||
|
--skip-validate-spec
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
nswag run ./src/Tribufu/api.nswag
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Runtime.Serialization;
|
|
||||||
|
|
||||||
namespace Tribufu.ComponentModel
|
|
||||||
{
|
|
||||||
public class EnumMemberConverter<T> : EnumConverter
|
|
||||||
{
|
|
||||||
public EnumMemberConverter(Type type) : base(type) { }
|
|
||||||
|
|
||||||
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
|
|
||||||
{
|
|
||||||
var type = typeof(T);
|
|
||||||
|
|
||||||
foreach (var field in type.GetFields())
|
|
||||||
{
|
|
||||||
if (Attribute.GetCustomAttribute(field, typeof(EnumMemberAttribute)) is EnumMemberAttribute attribute && value is string enumValue && attribute.Value == enumValue)
|
|
||||||
{
|
|
||||||
return field.GetValue(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return base.ConvertFrom(context, culture, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackageId>Tribufu.ComponentModel</PackageId>
|
|
||||||
<Description>Tribufu Component Model Helpers</Description>
|
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
34
src/Tribufu.Example/Program.cs
Normal file
34
src/Tribufu.Example/Program.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (c) Tribufu. All Rights Reserved.
|
||||||
|
// SPDX-License-Identifier: UNLICENSED
|
||||||
|
|
||||||
|
using dotenv.net;
|
||||||
|
using Tribufu.Generated.Client;
|
||||||
|
using Tribufu.SafeCheck;
|
||||||
|
|
||||||
|
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();
|
||||||
|
var safecheck = new TribufuSafeCheck(apiKey, "http://localhost:5100");
|
||||||
|
var result = await safecheck.CheckImageAsync("");
|
||||||
|
Console.WriteLine(result);
|
||||||
|
}
|
||||||
|
catch (ApiException e)
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
src/Tribufu.Example/Tribufu.Example.csproj
Normal file
15
src/Tribufu.Example/Tribufu.Example.csproj
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="dotenv.net" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Tribufu\Tribufu.csproj" />
|
||||||
|
<ProjectReference Include="..\Tribufu.SafeCheck\Tribufu.SafeCheck.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
15035
src/Tribufu.Generated/Api/TribufuGeneratedApi.cs
Normal file
15035
src/Tribufu.Generated/Api/TribufuGeneratedApi.cs
Normal file
File diff suppressed because it is too large
Load Diff
823
src/Tribufu.Generated/Client/ApiClient.cs
Normal file
823
src/Tribufu.Generated/Client/ApiClient.cs
Normal file
@@ -0,0 +1,823 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Runtime.Serialization.Formatters;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Serialization;
|
||||||
|
using RestSharp;
|
||||||
|
using RestSharp.Serializers;
|
||||||
|
using RestSharpMethod = RestSharp.Method;
|
||||||
|
using FileIO = System.IO.File;
|
||||||
|
using Polly;
|
||||||
|
using Tribufu.Generated.Model;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
|
||||||
|
/// </summary>
|
||||||
|
internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer
|
||||||
|
{
|
||||||
|
private readonly IReadableConfiguration _configuration;
|
||||||
|
private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
// OpenAPI generated types generally hide default constructors.
|
||||||
|
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||||
|
ContractResolver = new DefaultContractResolver
|
||||||
|
{
|
||||||
|
NamingStrategy = new CamelCaseNamingStrategy
|
||||||
|
{
|
||||||
|
OverrideSpecifiedNames = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public CustomJsonCodec(IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
_serializerSettings = serializerSettings;
|
||||||
|
_configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serialize the object into a JSON string.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">Object to be serialized.</param>
|
||||||
|
/// <returns>A JSON string.</returns>
|
||||||
|
public string Serialize(object obj)
|
||||||
|
{
|
||||||
|
if (obj != null && obj is AbstractOpenAPISchema)
|
||||||
|
{
|
||||||
|
// the object to be serialized is an oneOf/anyOf schema
|
||||||
|
return ((AbstractOpenAPISchema)obj).ToJson();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(obj, _serializerSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value);
|
||||||
|
|
||||||
|
public T Deserialize<T>(RestResponse response)
|
||||||
|
{
|
||||||
|
var result = (T)Deserialize(response, typeof(T));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deserialize the JSON string into a proper object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="response">The HTTP response.</param>
|
||||||
|
/// <param name="type">Object type.</param>
|
||||||
|
/// <returns>Object representation of the JSON string.</returns>
|
||||||
|
internal object Deserialize(RestResponse response, Type type)
|
||||||
|
{
|
||||||
|
if (type == typeof(byte[])) // return byte array
|
||||||
|
{
|
||||||
|
return response.RawBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
|
||||||
|
if (type == typeof(Stream))
|
||||||
|
{
|
||||||
|
var bytes = response.RawBytes;
|
||||||
|
if (response.Headers != null)
|
||||||
|
{
|
||||||
|
var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||||
|
? global::System.IO.Path.GetTempPath()
|
||||||
|
: _configuration.TempFolderPath;
|
||||||
|
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||||
|
foreach (var header in response.Headers)
|
||||||
|
{
|
||||||
|
var match = regex.Match(header.ToString());
|
||||||
|
if (match.Success)
|
||||||
|
{
|
||||||
|
string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
|
||||||
|
FileIO.WriteAllBytes(fileName, bytes);
|
||||||
|
return new FileStream(fileName, FileMode.Open);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var stream = new MemoryStream(bytes);
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
|
||||||
|
{
|
||||||
|
return DateTime.Parse(response.Content, null, DateTimeStyles.RoundtripKind);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type
|
||||||
|
{
|
||||||
|
return Convert.ChangeType(response.Content, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
// at this point, it must be a model (json)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new ApiException(500, e.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ISerializer Serializer => this;
|
||||||
|
public IDeserializer Deserializer => this;
|
||||||
|
|
||||||
|
public string[] AcceptedContentTypes => ContentType.JsonAccept;
|
||||||
|
|
||||||
|
public SupportsContentType SupportsContentType => contentType =>
|
||||||
|
contentType.Value.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) ||
|
||||||
|
contentType.Value.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
|
public ContentType ContentType { get; set; } = ContentType.Json;
|
||||||
|
|
||||||
|
public DataFormat DataFormat => DataFormat.Json;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
|
||||||
|
/// encapsulating general REST accessor use cases.
|
||||||
|
/// </summary>
|
||||||
|
public partial class ApiClient : ISynchronousClient, IAsynchronousClient
|
||||||
|
{
|
||||||
|
private readonly string _baseUrl;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
||||||
|
/// These settings can be adjusted to accommodate custom serialization rules.
|
||||||
|
/// </summary>
|
||||||
|
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
// OpenAPI generated types generally hide default constructors.
|
||||||
|
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||||
|
ContractResolver = new DefaultContractResolver
|
||||||
|
{
|
||||||
|
NamingStrategy = new CamelCaseNamingStrategy
|
||||||
|
{
|
||||||
|
OverrideSpecifiedNames = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows for extending request processing for <see cref="ApiClient"/> generated code.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The RestSharp request object</param>
|
||||||
|
partial void InterceptRequest(RestRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows for extending response processing for <see cref="ApiClient"/> generated code.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The RestSharp request object</param>
|
||||||
|
/// <param name="response">The RestSharp response object</param>
|
||||||
|
partial void InterceptResponse(RestRequest request, RestResponse response);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
|
||||||
|
/// </summary>
|
||||||
|
public ApiClient()
|
||||||
|
{
|
||||||
|
_baseUrl = GlobalConfiguration.Instance.BasePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiClient" />
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="basePath">The target service's base path in URL format.</param>
|
||||||
|
/// <exception cref="ArgumentException"></exception>
|
||||||
|
public ApiClient(string basePath)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(basePath))
|
||||||
|
throw new ArgumentException("basePath cannot be empty");
|
||||||
|
|
||||||
|
_baseUrl = basePath;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs the RestSharp version of an http method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="method">Swagger Client Custom HttpMethod</param>
|
||||||
|
/// <returns>RestSharp's HttpMethod instance.</returns>
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
||||||
|
private RestSharpMethod Method(HttpMethod method)
|
||||||
|
{
|
||||||
|
RestSharpMethod other;
|
||||||
|
switch (method)
|
||||||
|
{
|
||||||
|
case HttpMethod.Get:
|
||||||
|
other = RestSharpMethod.Get;
|
||||||
|
break;
|
||||||
|
case HttpMethod.Post:
|
||||||
|
other = RestSharpMethod.Post;
|
||||||
|
break;
|
||||||
|
case HttpMethod.Put:
|
||||||
|
other = RestSharpMethod.Put;
|
||||||
|
break;
|
||||||
|
case HttpMethod.Delete:
|
||||||
|
other = RestSharpMethod.Delete;
|
||||||
|
break;
|
||||||
|
case HttpMethod.Head:
|
||||||
|
other = RestSharpMethod.Head;
|
||||||
|
break;
|
||||||
|
case HttpMethod.Options:
|
||||||
|
other = RestSharpMethod.Options;
|
||||||
|
break;
|
||||||
|
case HttpMethod.Patch:
|
||||||
|
other = RestSharpMethod.Patch;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException("method", method, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return other;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides all logic for constructing a new RestSharp <see cref="RestRequest"/>.
|
||||||
|
/// At this point, all information for querying the service is known.
|
||||||
|
/// Here, it is simply mapped into the RestSharp request.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="method">The http verb.</param>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object.
|
||||||
|
/// It is assumed that any merge with GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>[private] A new RestRequest instance.</returns>
|
||||||
|
/// <exception cref="ArgumentNullException"></exception>
|
||||||
|
private RestRequest NewRequest(
|
||||||
|
HttpMethod method,
|
||||||
|
string path,
|
||||||
|
RequestOptions options,
|
||||||
|
IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
if (path == null) throw new ArgumentNullException("path");
|
||||||
|
if (options == null) throw new ArgumentNullException("options");
|
||||||
|
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||||
|
|
||||||
|
RestRequest request = new RestRequest(path, Method(method));
|
||||||
|
|
||||||
|
if (options.PathParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var pathParam in options.PathParameters)
|
||||||
|
{
|
||||||
|
request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.QueryParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var queryParam in options.QueryParameters)
|
||||||
|
{
|
||||||
|
foreach (var value in queryParam.Value)
|
||||||
|
{
|
||||||
|
request.AddQueryParameter(queryParam.Key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (configuration.DefaultHeaders != null)
|
||||||
|
{
|
||||||
|
foreach (var headerParam in configuration.DefaultHeaders)
|
||||||
|
{
|
||||||
|
request.AddHeader(headerParam.Key, headerParam.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.HeaderParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var headerParam in options.HeaderParameters)
|
||||||
|
{
|
||||||
|
foreach (var value in headerParam.Value)
|
||||||
|
{
|
||||||
|
request.AddOrUpdateHeader(headerParam.Key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.FormParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var formParam in options.FormParameters)
|
||||||
|
{
|
||||||
|
request.AddParameter(formParam.Key, formParam.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.Data != null)
|
||||||
|
{
|
||||||
|
if (options.Data is Stream stream)
|
||||||
|
{
|
||||||
|
var contentType = "application/octet-stream";
|
||||||
|
if (options.HeaderParameters != null)
|
||||||
|
{
|
||||||
|
var contentTypes = options.HeaderParameters["Content-Type"];
|
||||||
|
contentType = contentTypes[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
var bytes = ClientUtils.ReadAsBytes(stream);
|
||||||
|
request.AddParameter(contentType, bytes, ParameterType.RequestBody);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (options.HeaderParameters != null)
|
||||||
|
{
|
||||||
|
var contentTypes = options.HeaderParameters["Content-Type"];
|
||||||
|
if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json")))
|
||||||
|
{
|
||||||
|
request.RequestFormat = DataFormat.Json;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly.
|
||||||
|
request.RequestFormat = DataFormat.Json;
|
||||||
|
}
|
||||||
|
|
||||||
|
request.AddJsonBody(options.Data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.FileParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var fileParam in options.FileParameters)
|
||||||
|
{
|
||||||
|
foreach (var file in fileParam.Value)
|
||||||
|
{
|
||||||
|
var bytes = ClientUtils.ReadAsBytes(file);
|
||||||
|
var fileStream = file as FileStream;
|
||||||
|
if (fileStream != null)
|
||||||
|
request.AddFile(fileParam.Key, bytes, global::System.IO.Path.GetFileName(fileStream.Name));
|
||||||
|
else
|
||||||
|
request.AddFile(fileParam.Key, bytes, "no_file_name_provided");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.HeaderParameters != null)
|
||||||
|
{
|
||||||
|
if (options.HeaderParameters.TryGetValue("Content-Type", out var contentTypes) && contentTypes.Any(header => header.Contains("multipart/form-data")))
|
||||||
|
{
|
||||||
|
request.AlwaysMultipartFormData = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return request;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Transforms a RestResponse instance into a new ApiResponse instance.
|
||||||
|
/// At this point, we have a concrete http response from the service.
|
||||||
|
/// Here, it is simply mapped into the [public] ApiResponse object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="response">The RestSharp response object</param>
|
||||||
|
/// <returns>A new ApiResponse instance.</returns>
|
||||||
|
private ApiResponse<T> ToApiResponse<T>(RestResponse<T> response)
|
||||||
|
{
|
||||||
|
T result = response.Data;
|
||||||
|
string rawContent = response.Content;
|
||||||
|
|
||||||
|
var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>(), result, rawContent)
|
||||||
|
{
|
||||||
|
ErrorText = response.ErrorMessage,
|
||||||
|
Cookies = new List<Cookie>()
|
||||||
|
};
|
||||||
|
|
||||||
|
if (response.Headers != null)
|
||||||
|
{
|
||||||
|
foreach (var responseHeader in response.Headers)
|
||||||
|
{
|
||||||
|
transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.ContentHeaders != null)
|
||||||
|
{
|
||||||
|
foreach (var responseHeader in response.ContentHeaders)
|
||||||
|
{
|
||||||
|
transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.Cookies != null)
|
||||||
|
{
|
||||||
|
foreach (var responseCookies in response.Cookies.Cast<Cookie>())
|
||||||
|
{
|
||||||
|
transformed.Cookies.Add(
|
||||||
|
new Cookie(
|
||||||
|
responseCookies.Name,
|
||||||
|
responseCookies.Value,
|
||||||
|
responseCookies.Path,
|
||||||
|
responseCookies.Domain)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return transformed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes the HTTP request for the current service.
|
||||||
|
/// Based on functions received it can be async or sync.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="getResponse">Local function that executes http request and returns http response.</param>
|
||||||
|
/// <param name="setOptions">Local function to specify options for the service.</param>
|
||||||
|
/// <param name="request">The RestSharp request object</param>
|
||||||
|
/// <param name="options">The RestSharp options object</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object.
|
||||||
|
/// It is assumed that any merge with GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A new ApiResponse instance.</returns>
|
||||||
|
private async Task<ApiResponse<T>> ExecClientAsync<T>(Func<RestClient, Task<RestResponse<T>>> getResponse, Action<RestClientOptions> setOptions, RestRequest request, RequestOptions options, IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl;
|
||||||
|
var clientOptions = new RestClientOptions(baseUrl)
|
||||||
|
{
|
||||||
|
ClientCertificates = configuration.ClientCertificates,
|
||||||
|
Timeout = configuration.Timeout,
|
||||||
|
Proxy = configuration.Proxy,
|
||||||
|
UserAgent = configuration.UserAgent,
|
||||||
|
UseDefaultCredentials = configuration.UseDefaultCredentials,
|
||||||
|
RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback
|
||||||
|
};
|
||||||
|
setOptions(clientOptions);
|
||||||
|
|
||||||
|
using (RestClient client = new RestClient(clientOptions,
|
||||||
|
configureSerialization: serializerConfig => serializerConfig.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration))))
|
||||||
|
{
|
||||||
|
InterceptRequest(request);
|
||||||
|
|
||||||
|
RestResponse<T> response = await getResponse(client);
|
||||||
|
|
||||||
|
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||||
|
if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response.Data = (T)typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content });
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw ex.InnerException != null ? ex.InnerException : ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Stream") // for binary response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "Byte[]") // for byte response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)response.RawBytes;
|
||||||
|
}
|
||||||
|
else if (typeof(T).Name == "String") // for string response
|
||||||
|
{
|
||||||
|
response.Data = (T)(object)response.Content;
|
||||||
|
}
|
||||||
|
|
||||||
|
InterceptResponse(request, response);
|
||||||
|
|
||||||
|
var result = ToApiResponse(response);
|
||||||
|
if (response.ErrorMessage != null)
|
||||||
|
{
|
||||||
|
result.ErrorText = response.ErrorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.Cookies != null && response.Cookies.Count > 0)
|
||||||
|
{
|
||||||
|
if (result.Cookies == null) result.Cookies = new List<Cookie>();
|
||||||
|
foreach (var restResponseCookie in response.Cookies.Cast<Cookie>())
|
||||||
|
{
|
||||||
|
var cookie = new Cookie(
|
||||||
|
restResponseCookie.Name,
|
||||||
|
restResponseCookie.Value,
|
||||||
|
restResponseCookie.Path,
|
||||||
|
restResponseCookie.Domain
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Comment = restResponseCookie.Comment,
|
||||||
|
CommentUri = restResponseCookie.CommentUri,
|
||||||
|
Discard = restResponseCookie.Discard,
|
||||||
|
Expired = restResponseCookie.Expired,
|
||||||
|
Expires = restResponseCookie.Expires,
|
||||||
|
HttpOnly = restResponseCookie.HttpOnly,
|
||||||
|
Port = restResponseCookie.Port,
|
||||||
|
Secure = restResponseCookie.Secure,
|
||||||
|
Version = restResponseCookie.Version
|
||||||
|
};
|
||||||
|
|
||||||
|
result.Cookies.Add(cookie);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<RestResponse<T>> DeserializeRestResponseFromPolicyAsync<T>(RestClient client, RestRequest request, PolicyResult<RestResponse> policyResult, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
if (policyResult.Outcome == OutcomeType.Successful)
|
||||||
|
{
|
||||||
|
return await client.Deserialize<T>(policyResult.Result, cancellationToken);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new RestResponse<T>(request)
|
||||||
|
{
|
||||||
|
ErrorException = policyResult.FinalException
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private ApiResponse<T> Exec<T>(RestRequest request, RequestOptions options, IReadableConfiguration configuration)
|
||||||
|
{
|
||||||
|
Action<RestClientOptions> setOptions = (clientOptions) =>
|
||||||
|
{
|
||||||
|
var cookies = new CookieContainer();
|
||||||
|
|
||||||
|
if (options.Cookies != null && options.Cookies.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var cookie in options.Cookies)
|
||||||
|
{
|
||||||
|
cookies.Add(new Cookie(cookie.Name, cookie.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clientOptions.CookieContainer = cookies;
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<RestClient, Task<RestResponse<T>>> getResponse = (client) =>
|
||||||
|
{
|
||||||
|
if (RetryConfiguration.RetryPolicy != null)
|
||||||
|
{
|
||||||
|
var policy = RetryConfiguration.RetryPolicy;
|
||||||
|
var policyResult = policy.ExecuteAndCapture(() => client.Execute(request));
|
||||||
|
return DeserializeRestResponseFromPolicyAsync<T>(client, request, policyResult);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Task.FromResult(client.Execute<T>(request));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return ExecClientAsync(getResponse, setOptions, request, options, configuration).GetAwaiter().GetResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task<ApiResponse<T>> ExecAsync<T>(RestRequest request, RequestOptions options, IReadableConfiguration configuration, CancellationToken cancellationToken = default(CancellationToken))
|
||||||
|
{
|
||||||
|
Action<RestClientOptions> setOptions = (clientOptions) =>
|
||||||
|
{
|
||||||
|
//no extra options
|
||||||
|
};
|
||||||
|
|
||||||
|
Func<RestClient, Task<RestResponse<T>>> getResponse = async (client) =>
|
||||||
|
{
|
||||||
|
if (RetryConfiguration.AsyncRetryPolicy != null)
|
||||||
|
{
|
||||||
|
var policy = RetryConfiguration.AsyncRetryPolicy;
|
||||||
|
var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(request, ct), cancellationToken).ConfigureAwait(false);
|
||||||
|
return await DeserializeRestResponseFromPolicyAsync<T>(client, request, policyResult, cancellationToken);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return await client.ExecuteAsync<T>(request, cancellationToken).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return ExecClientAsync(getResponse, setOptions, request, options, configuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region IAsynchronousClient
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP GET request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP POST request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP PUT request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP DELETE request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP HEAD request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP OPTION request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP PATCH request (async).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken);
|
||||||
|
}
|
||||||
|
#endregion IAsynchronousClient
|
||||||
|
|
||||||
|
#region ISynchronousClient
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP GET request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Get, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP POST request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Post, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP PUT request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Put, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP DELETE request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Delete, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP HEAD request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Head, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP OPTION request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Options, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Make a HTTP PATCH request (synchronous).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The target path (or resource).</param>
|
||||||
|
/// <param name="options">The additional request options.</param>
|
||||||
|
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||||
|
/// GlobalConfiguration has been done before calling this method.</param>
|
||||||
|
/// <returns>A Task containing ApiResponse</returns>
|
||||||
|
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
var config = configuration ?? GlobalConfiguration.Instance;
|
||||||
|
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), options, config);
|
||||||
|
}
|
||||||
|
#endregion ISynchronousClient
|
||||||
|
}
|
||||||
|
}
|
||||||
69
src/Tribufu.Generated/Client/ApiException.cs
Normal file
69
src/Tribufu.Generated/Client/ApiException.cs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// API Exception
|
||||||
|
/// </summary>
|
||||||
|
public class ApiException : Exception
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the error code (HTTP status code)
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The error code (HTTP status code).</value>
|
||||||
|
public int ErrorCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the error content (body json object)
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The error content (Http response body).</value>
|
||||||
|
public object ErrorContent { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the HTTP headers
|
||||||
|
/// </summary>
|
||||||
|
/// <value>HTTP headers</value>
|
||||||
|
public Multimap<string, string> Headers { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||||
|
/// </summary>
|
||||||
|
public ApiException() { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="errorCode">HTTP status code.</param>
|
||||||
|
/// <param name="message">Error message.</param>
|
||||||
|
public ApiException(int errorCode, string message) : base(message)
|
||||||
|
{
|
||||||
|
this.ErrorCode = errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="errorCode">HTTP status code.</param>
|
||||||
|
/// <param name="message">Error message.</param>
|
||||||
|
/// <param name="errorContent">Error content.</param>
|
||||||
|
/// <param name="headers">HTTP Headers.</param>
|
||||||
|
public ApiException(int errorCode, string message, object errorContent = null, Multimap<string, string> headers = null) : base(message)
|
||||||
|
{
|
||||||
|
this.ErrorCode = errorCode;
|
||||||
|
this.ErrorContent = errorContent;
|
||||||
|
this.Headers = headers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
167
src/Tribufu.Generated/Client/ApiResponse.cs
Normal file
167
src/Tribufu.Generated/Client/ApiResponse.cs
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a non-generic contract for the ApiResponse wrapper.
|
||||||
|
/// </summary>
|
||||||
|
public interface IApiResponse
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The data type of <see cref="Content"/>
|
||||||
|
/// </summary>
|
||||||
|
Type ResponseType { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The content of this response
|
||||||
|
/// </summary>
|
||||||
|
Object Content { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the status code (HTTP status code)
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The status code.</value>
|
||||||
|
HttpStatusCode StatusCode { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the HTTP headers
|
||||||
|
/// </summary>
|
||||||
|
/// <value>HTTP headers</value>
|
||||||
|
Multimap<string, string> Headers { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets any error text defined by the calling client.
|
||||||
|
/// </summary>
|
||||||
|
string ErrorText { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets any cookies passed along on the response.
|
||||||
|
/// </summary>
|
||||||
|
List<Cookie> Cookies { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The raw content of this response
|
||||||
|
/// </summary>
|
||||||
|
string RawContent { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// API Response
|
||||||
|
/// </summary>
|
||||||
|
public class ApiResponse<T> : IApiResponse
|
||||||
|
{
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the status code (HTTP status code)
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The status code.</value>
|
||||||
|
public HttpStatusCode StatusCode { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the HTTP headers
|
||||||
|
/// </summary>
|
||||||
|
/// <value>HTTP headers</value>
|
||||||
|
public Multimap<string, string> Headers { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the data (parsed HTTP body)
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The data.</value>
|
||||||
|
public T Data { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets any error text defined by the calling client.
|
||||||
|
/// </summary>
|
||||||
|
public string ErrorText { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets any cookies passed along on the response.
|
||||||
|
/// </summary>
|
||||||
|
public List<Cookie> Cookies { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The content of this response
|
||||||
|
/// </summary>
|
||||||
|
public Type ResponseType
|
||||||
|
{
|
||||||
|
get { return typeof(T); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The data type of <see cref="Content"/>
|
||||||
|
/// </summary>
|
||||||
|
public object Content
|
||||||
|
{
|
||||||
|
get { return Data; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The raw content
|
||||||
|
/// </summary>
|
||||||
|
public string RawContent { get; }
|
||||||
|
|
||||||
|
#endregion Properties
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="statusCode">HTTP status code.</param>
|
||||||
|
/// <param name="headers">HTTP headers.</param>
|
||||||
|
/// <param name="data">Data (parsed HTTP body)</param>
|
||||||
|
/// <param name="rawContent">Raw content.</param>
|
||||||
|
public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data, string rawContent)
|
||||||
|
{
|
||||||
|
StatusCode = statusCode;
|
||||||
|
Headers = headers;
|
||||||
|
Data = data;
|
||||||
|
RawContent = rawContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="statusCode">HTTP status code.</param>
|
||||||
|
/// <param name="headers">HTTP headers.</param>
|
||||||
|
/// <param name="data">Data (parsed HTTP body)</param>
|
||||||
|
public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data) : this(statusCode, headers, data, null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="statusCode">HTTP status code.</param>
|
||||||
|
/// <param name="data">Data (parsed HTTP body)</param>
|
||||||
|
/// <param name="rawContent">Raw content.</param>
|
||||||
|
public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="statusCode">HTTP status code.</param>
|
||||||
|
/// <param name="data">Data (parsed HTTP body)</param>
|
||||||
|
public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Constructors
|
||||||
|
}
|
||||||
|
}
|
||||||
254
src/Tribufu.Generated/Client/ClientUtils.cs
Normal file
254
src/Tribufu.Generated/Client/ClientUtils.cs
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Utility functions providing some benefit to API client consumers.
|
||||||
|
/// </summary>
|
||||||
|
public static class ClientUtils
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Sanitize filename by removing the path
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="filename">Filename</param>
|
||||||
|
/// <returns>Filename</returns>
|
||||||
|
public static string SanitizeFilename(string filename)
|
||||||
|
{
|
||||||
|
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||||
|
return match.Success ? match.Groups[1].Value : filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Convert params to key/value pairs.
|
||||||
|
/// Use collectionFormat to properly format lists and collections.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="collectionFormat">The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi</param>
|
||||||
|
/// <param name="name">Key name.</param>
|
||||||
|
/// <param name="value">Value object.</param>
|
||||||
|
/// <returns>A multimap of keys with 1..n associated values.</returns>
|
||||||
|
public static Multimap<string, string> ParameterToMultiMap(string collectionFormat, string name, object value)
|
||||||
|
{
|
||||||
|
var parameters = new Multimap<string, string>();
|
||||||
|
|
||||||
|
if (value is ICollection collection && collectionFormat == "multi")
|
||||||
|
{
|
||||||
|
foreach (var item in collection)
|
||||||
|
{
|
||||||
|
parameters.Add(name, ParameterToString(item));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (value is IDictionary dictionary)
|
||||||
|
{
|
||||||
|
if(collectionFormat == "deepObject") {
|
||||||
|
foreach (DictionaryEntry entry in dictionary)
|
||||||
|
{
|
||||||
|
parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
foreach (DictionaryEntry entry in dictionary)
|
||||||
|
{
|
||||||
|
parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parameters.Add(name, ParameterToString(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
|
||||||
|
/// If parameter is a list, join the list with ",".
|
||||||
|
/// Otherwise just return the string.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">The parameter (header, path, query, form).</param>
|
||||||
|
/// <param name="configuration">An optional configuration instance, providing formatting options used in processing.</param>
|
||||||
|
/// <returns>Formatted string.</returns>
|
||||||
|
public static string ParameterToString(object obj, IReadableConfiguration configuration = null)
|
||||||
|
{
|
||||||
|
if (obj is DateTime dateTime)
|
||||||
|
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||||
|
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||||
|
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||||
|
// For example: 2009-06-15T13:45:30.0000000
|
||||||
|
return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||||
|
if (obj is DateTimeOffset dateTimeOffset)
|
||||||
|
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||||
|
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||||
|
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||||
|
// For example: 2009-06-15T13:45:30.0000000
|
||||||
|
return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||||
|
if (obj is DateOnly dateOnly)
|
||||||
|
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||||
|
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||||
|
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||||
|
// For example: 2009-06-15
|
||||||
|
return dateOnly.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||||
|
if (obj is bool boolean)
|
||||||
|
return boolean ? "true" : "false";
|
||||||
|
if (obj is ICollection collection) {
|
||||||
|
List<string> entries = new List<string>();
|
||||||
|
foreach (var entry in collection)
|
||||||
|
entries.Add(ParameterToString(entry, configuration));
|
||||||
|
return string.Join(",", entries);
|
||||||
|
}
|
||||||
|
if (obj is Enum && HasEnumMemberAttrValue(obj))
|
||||||
|
return GetEnumMemberAttrValue(obj);
|
||||||
|
|
||||||
|
return Convert.ToString(obj, CultureInfo.InvariantCulture);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serializes the given object when not null. Otherwise return null.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="obj">The object to serialize.</param>
|
||||||
|
/// <returns>Serialized string.</returns>
|
||||||
|
public static string Serialize(object obj)
|
||||||
|
{
|
||||||
|
return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Encode string in base64 format.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="text">string to be encoded.</param>
|
||||||
|
/// <returns>Encoded string.</returns>
|
||||||
|
public static string Base64Encode(string text)
|
||||||
|
{
|
||||||
|
return Convert.ToBase64String(global::System.Text.Encoding.UTF8.GetBytes(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Convert stream to byte array
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="inputStream">Input stream to be converted</param>
|
||||||
|
/// <returns>Byte array</returns>
|
||||||
|
public static byte[] ReadAsBytes(Stream inputStream)
|
||||||
|
{
|
||||||
|
using (var ms = new MemoryStream())
|
||||||
|
{
|
||||||
|
inputStream.CopyTo(ms);
|
||||||
|
return ms.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Select the Content-Type header's value from the given content-type array:
|
||||||
|
/// if JSON type exists in the given array, use it;
|
||||||
|
/// otherwise use the first one defined in 'consumes'
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="contentTypes">The Content-Type array to select from.</param>
|
||||||
|
/// <returns>The Content-Type header to use.</returns>
|
||||||
|
public static string SelectHeaderContentType(string[] contentTypes)
|
||||||
|
{
|
||||||
|
if (contentTypes.Length == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
foreach (var contentType in contentTypes)
|
||||||
|
{
|
||||||
|
if (IsJsonMime(contentType))
|
||||||
|
return contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return contentTypes[0]; // use the first content type specified in 'consumes'
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Select the Accept header's value from the given accepts array:
|
||||||
|
/// if JSON exists in the given array, use it;
|
||||||
|
/// otherwise use all of them (joining into a string)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="accepts">The accepts array to select from.</param>
|
||||||
|
/// <returns>The Accept header to use.</returns>
|
||||||
|
public static string SelectHeaderAccept(string[] accepts)
|
||||||
|
{
|
||||||
|
if (accepts.Length == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
|
||||||
|
return "application/json";
|
||||||
|
|
||||||
|
return string.Join(",", accepts);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a case-insensitive check that a provided content type is a known JSON-like content type.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Check if the given MIME is a JSON MIME.
|
||||||
|
/// JSON MIME examples:
|
||||||
|
/// application/json
|
||||||
|
/// application/json; charset=UTF8
|
||||||
|
/// APPLICATION/JSON
|
||||||
|
/// application/vnd.company+json
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mime">MIME</param>
|
||||||
|
/// <returns>Returns True if MIME type is json.</returns>
|
||||||
|
public static bool IsJsonMime(string mime)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(mime)) return false;
|
||||||
|
|
||||||
|
return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Is the Enum decorated with EnumMember Attribute
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enumVal"></param>
|
||||||
|
/// <returns>true if found</returns>
|
||||||
|
private static bool HasEnumMemberAttrValue(object enumVal)
|
||||||
|
{
|
||||||
|
if (enumVal == null)
|
||||||
|
throw new ArgumentNullException(nameof(enumVal));
|
||||||
|
var enumType = enumVal.GetType();
|
||||||
|
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
|
||||||
|
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
|
||||||
|
if (attr != null) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the EnumMember value
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="enumVal"></param>
|
||||||
|
/// <returns>EnumMember value as string otherwise null</returns>
|
||||||
|
private static string GetEnumMemberAttrValue(object enumVal)
|
||||||
|
{
|
||||||
|
if (enumVal == null)
|
||||||
|
throw new ArgumentNullException(nameof(enumVal));
|
||||||
|
var enumType = enumVal.GetType();
|
||||||
|
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
|
||||||
|
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
|
||||||
|
if (attr != null)
|
||||||
|
{
|
||||||
|
return attr.Value;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
613
src/Tribufu.Generated/Client/Configuration.cs
Normal file
613
src/Tribufu.Generated/Client/Configuration.cs
Normal file
@@ -0,0 +1,613 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Text;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.Security;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a set of configuration settings
|
||||||
|
/// </summary>
|
||||||
|
public class Configuration : IReadableConfiguration
|
||||||
|
{
|
||||||
|
#region Constants
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Version of the package.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Version of the package.</value>
|
||||||
|
public const string Version = "1.0.0";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Identifier for ISO 8601 DateTime Format
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.</remarks>
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
|
public const string ISO8601_DATETIME_FORMAT = "o";
|
||||||
|
|
||||||
|
#endregion Constants
|
||||||
|
|
||||||
|
#region Static Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default creation of exceptions for a given method name and response object
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
|
||||||
|
{
|
||||||
|
var status = (int)response.StatusCode;
|
||||||
|
if (status >= 400)
|
||||||
|
{
|
||||||
|
return new ApiException(status,
|
||||||
|
string.Format("Error calling {0}: {1}", methodName, response.RawContent),
|
||||||
|
response.RawContent, response.Headers);
|
||||||
|
}
|
||||||
|
if (status == 0)
|
||||||
|
{
|
||||||
|
return new ApiException(status,
|
||||||
|
string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endregion Static Members
|
||||||
|
|
||||||
|
#region Private Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines the base path of the target API server.
|
||||||
|
/// Example: http://localhost:3000/v1/
|
||||||
|
/// </summary>
|
||||||
|
private string _basePath;
|
||||||
|
|
||||||
|
private bool _useDefaultCredentials = false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the API key based on the authentication name.
|
||||||
|
/// This is the key and value comprising the "secret" for accessing an API.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The API key.</value>
|
||||||
|
private IDictionary<string, string> _apiKey;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The prefix of the API key.</value>
|
||||||
|
private IDictionary<string, string> _apiKeyPrefix;
|
||||||
|
|
||||||
|
private string _dateTimeFormat = ISO8601_DATETIME_FORMAT;
|
||||||
|
private string _tempFolderPath = Path.GetTempPath();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the servers defined in the OpenAPI spec.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The servers</value>
|
||||||
|
private IList<IReadOnlyDictionary<string, object>> _servers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the operation servers defined in the OpenAPI spec.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The operation servers</value>
|
||||||
|
private IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> _operationServers;
|
||||||
|
|
||||||
|
#endregion Private Members
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Configuration" /> class
|
||||||
|
/// </summary>
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
|
||||||
|
public Configuration()
|
||||||
|
{
|
||||||
|
Proxy = null;
|
||||||
|
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");
|
||||||
|
BasePath = "http://localhost";
|
||||||
|
DefaultHeaders = new ConcurrentDictionary<string, string>();
|
||||||
|
ApiKey = new ConcurrentDictionary<string, string>();
|
||||||
|
ApiKeyPrefix = new ConcurrentDictionary<string, string>();
|
||||||
|
Servers = new List<IReadOnlyDictionary<string, object>>()
|
||||||
|
{
|
||||||
|
{
|
||||||
|
new Dictionary<string, object> {
|
||||||
|
{"url", ""},
|
||||||
|
{"description", "No description provided"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
OperationServers = new Dictionary<string, List<IReadOnlyDictionary<string, object>>>()
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
// Setting Timeout has side effects (forces ApiClient creation).
|
||||||
|
Timeout = TimeSpan.FromSeconds(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Configuration" /> class
|
||||||
|
/// </summary>
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
|
||||||
|
public Configuration(
|
||||||
|
IDictionary<string, string> defaultHeaders,
|
||||||
|
IDictionary<string, string> apiKey,
|
||||||
|
IDictionary<string, string> apiKeyPrefix,
|
||||||
|
string basePath = "http://localhost") : this()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(basePath))
|
||||||
|
throw new ArgumentException("The provided basePath is invalid.", "basePath");
|
||||||
|
if (defaultHeaders == null)
|
||||||
|
throw new ArgumentNullException("defaultHeaders");
|
||||||
|
if (apiKey == null)
|
||||||
|
throw new ArgumentNullException("apiKey");
|
||||||
|
if (apiKeyPrefix == null)
|
||||||
|
throw new ArgumentNullException("apiKeyPrefix");
|
||||||
|
|
||||||
|
BasePath = basePath;
|
||||||
|
|
||||||
|
foreach (var keyValuePair in defaultHeaders)
|
||||||
|
{
|
||||||
|
DefaultHeaders.Add(keyValuePair);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var keyValuePair in apiKey)
|
||||||
|
{
|
||||||
|
ApiKey.Add(keyValuePair);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var keyValuePair in apiKeyPrefix)
|
||||||
|
{
|
||||||
|
ApiKeyPrefix.Add(keyValuePair);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Constructors
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the base path for API access.
|
||||||
|
/// </summary>
|
||||||
|
public virtual string BasePath
|
||||||
|
{
|
||||||
|
get { return _basePath; }
|
||||||
|
set { _basePath = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool UseDefaultCredentials
|
||||||
|
{
|
||||||
|
get { return _useDefaultCredentials; }
|
||||||
|
set { _useDefaultCredentials = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the default header.
|
||||||
|
/// </summary>
|
||||||
|
[Obsolete("Use DefaultHeaders instead.")]
|
||||||
|
public virtual IDictionary<string, string> DefaultHeader
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return DefaultHeaders;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
DefaultHeaders = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the default headers.
|
||||||
|
/// </summary>
|
||||||
|
public virtual IDictionary<string, string> DefaultHeaders { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the HTTP timeout of ApiClient. Defaults to 100 seconds.
|
||||||
|
/// </summary>
|
||||||
|
public virtual TimeSpan Timeout { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the proxy
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Proxy.</value>
|
||||||
|
public virtual WebProxy Proxy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the HTTP user agent.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Http user agent.</value>
|
||||||
|
public virtual string UserAgent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the username (HTTP basic authentication).
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The username.</value>
|
||||||
|
public virtual string Username { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the password (HTTP basic authentication).
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The password.</value>
|
||||||
|
public virtual string Password { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the API key with prefix.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
|
||||||
|
/// <returns>API key with prefix.</returns>
|
||||||
|
public string GetApiKeyWithPrefix(string apiKeyIdentifier)
|
||||||
|
{
|
||||||
|
string apiKeyValue;
|
||||||
|
ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue);
|
||||||
|
string apiKeyPrefix;
|
||||||
|
if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix))
|
||||||
|
{
|
||||||
|
return apiKeyPrefix + " " + apiKeyValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return apiKeyValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets certificate collection to be sent with requests.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>X509 Certificate collection.</value>
|
||||||
|
public X509CertificateCollection ClientCertificates { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the access token for OAuth2 authentication.
|
||||||
|
///
|
||||||
|
/// This helper property simplifies code generation.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The access token.</value>
|
||||||
|
public virtual string AccessToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the temporary folder path to store the files downloaded from the server.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Folder path.</value>
|
||||||
|
public virtual string TempFolderPath
|
||||||
|
{
|
||||||
|
get { return _tempFolderPath; }
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(value))
|
||||||
|
{
|
||||||
|
_tempFolderPath = Path.GetTempPath();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// create the directory if it does not exist
|
||||||
|
if (!Directory.Exists(value))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if the path contains directory separator at the end
|
||||||
|
if (value[value.Length - 1] == Path.DirectorySeparatorChar)
|
||||||
|
{
|
||||||
|
_tempFolderPath = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_tempFolderPath = value + Path.DirectorySeparatorChar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the date time format used when serializing in the ApiClient
|
||||||
|
/// By default, it's set to ISO 8601 - "o", for others see:
|
||||||
|
/// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
|
||||||
|
/// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
|
||||||
|
/// No validation is done to ensure that the string you're providing is valid
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The DateTimeFormat string</value>
|
||||||
|
public virtual string DateTimeFormat
|
||||||
|
{
|
||||||
|
get { return _dateTimeFormat; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(value))
|
||||||
|
{
|
||||||
|
// Never allow a blank or null string, go back to the default
|
||||||
|
_dateTimeFormat = ISO8601_DATETIME_FORMAT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Caution, no validation when you choose date time format other than ISO 8601
|
||||||
|
// Take a look at the above links
|
||||||
|
_dateTimeFormat = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
|
||||||
|
///
|
||||||
|
/// Whatever you set here will be prepended to the value defined in AddApiKey.
|
||||||
|
///
|
||||||
|
/// An example invocation here might be:
|
||||||
|
/// <example>
|
||||||
|
/// ApiKeyPrefix["Authorization"] = "Bearer";
|
||||||
|
/// </example>
|
||||||
|
/// … where ApiKey["Authorization"] would then be used to set the value of your bearer token.
|
||||||
|
///
|
||||||
|
/// <remarks>
|
||||||
|
/// OAuth2 workflows should set tokens via AccessToken.
|
||||||
|
/// </remarks>
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The prefix of the API key.</value>
|
||||||
|
public virtual IDictionary<string, string> ApiKeyPrefix
|
||||||
|
{
|
||||||
|
get { return _apiKeyPrefix; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("ApiKeyPrefix collection may not be null.");
|
||||||
|
}
|
||||||
|
_apiKeyPrefix = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the API key based on the authentication name.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The API key.</value>
|
||||||
|
public virtual IDictionary<string, string> ApiKey
|
||||||
|
{
|
||||||
|
get { return _apiKey; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("ApiKey collection may not be null.");
|
||||||
|
}
|
||||||
|
_apiKey = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the servers.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The servers.</value>
|
||||||
|
public virtual IList<IReadOnlyDictionary<string, object>> Servers
|
||||||
|
{
|
||||||
|
get { return _servers; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Servers may not be null.");
|
||||||
|
}
|
||||||
|
_servers = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the operation servers.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The operation servers.</value>
|
||||||
|
public virtual IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers
|
||||||
|
{
|
||||||
|
get { return _operationServers; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Operation servers may not be null.");
|
||||||
|
}
|
||||||
|
_operationServers = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns URL based on server settings without providing values
|
||||||
|
/// for the variables
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index">Array index of the server settings.</param>
|
||||||
|
/// <return>The server URL.</return>
|
||||||
|
public string GetServerUrl(int index)
|
||||||
|
{
|
||||||
|
return GetServerUrl(Servers, index, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns URL based on server settings.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="index">Array index of the server settings.</param>
|
||||||
|
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
|
||||||
|
/// <return>The server URL.</return>
|
||||||
|
public string GetServerUrl(int index, Dictionary<string, string> inputVariables)
|
||||||
|
{
|
||||||
|
return GetServerUrl(Servers, index, inputVariables);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns URL based on operation server settings.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="operation">Operation associated with the request path.</param>
|
||||||
|
/// <param name="index">Array index of the server settings.</param>
|
||||||
|
/// <return>The operation server URL.</return>
|
||||||
|
public string GetOperationServerUrl(string operation, int index)
|
||||||
|
{
|
||||||
|
return GetOperationServerUrl(operation, index, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns URL based on operation server settings.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="operation">Operation associated with the request path.</param>
|
||||||
|
/// <param name="index">Array index of the server settings.</param>
|
||||||
|
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
|
||||||
|
/// <return>The operation server URL.</return>
|
||||||
|
public string GetOperationServerUrl(string operation, int index, Dictionary<string, string> inputVariables)
|
||||||
|
{
|
||||||
|
if (operation != null && OperationServers.TryGetValue(operation, out var operationServer))
|
||||||
|
{
|
||||||
|
return GetServerUrl(operationServer, index, inputVariables);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns URL based on server settings.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="servers">Dictionary of server settings.</param>
|
||||||
|
/// <param name="index">Array index of the server settings.</param>
|
||||||
|
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
|
||||||
|
/// <return>The server URL.</return>
|
||||||
|
private string GetServerUrl(IList<IReadOnlyDictionary<string, object>> servers, int index, Dictionary<string, string> inputVariables)
|
||||||
|
{
|
||||||
|
if (index < 0 || index >= servers.Count)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputVariables == null)
|
||||||
|
{
|
||||||
|
inputVariables = new Dictionary<string, string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
IReadOnlyDictionary<string, object> server = servers[index];
|
||||||
|
string url = (string)server["url"];
|
||||||
|
|
||||||
|
if (server.ContainsKey("variables"))
|
||||||
|
{
|
||||||
|
// go through each variable and assign a value
|
||||||
|
foreach (KeyValuePair<string, object> variable in (IReadOnlyDictionary<string, object>)server["variables"])
|
||||||
|
{
|
||||||
|
|
||||||
|
IReadOnlyDictionary<string, object> serverVariables = (IReadOnlyDictionary<string, object>)(variable.Value);
|
||||||
|
|
||||||
|
if (inputVariables.ContainsKey(variable.Key))
|
||||||
|
{
|
||||||
|
if (((List<string>)serverVariables["enum_values"]).Contains(inputVariables[variable.Key]))
|
||||||
|
{
|
||||||
|
url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List<string>)serverVariables["enum_values"]}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// use default value
|
||||||
|
url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and Sets the RemoteCertificateValidationCallback
|
||||||
|
/// </summary>
|
||||||
|
public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
|
||||||
|
|
||||||
|
#endregion Properties
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a string with essential information for debugging.
|
||||||
|
/// </summary>
|
||||||
|
public static string ToDebugReport()
|
||||||
|
{
|
||||||
|
string report = "C# SDK (Tribufu.Generated) Debug Report:\n";
|
||||||
|
report += " OS: " + System.Environment.OSVersion + "\n";
|
||||||
|
report += " .NET Framework Version: " + System.Environment.Version + "\n";
|
||||||
|
report += " Version of the API: 1.1.0\n";
|
||||||
|
report += " SDK Package Version: 1.0.0\n";
|
||||||
|
|
||||||
|
return report;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add Api Key Header.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">Api Key name.</param>
|
||||||
|
/// <param name="value">Api Key value.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public void AddApiKey(string key, string value)
|
||||||
|
{
|
||||||
|
ApiKey[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the API key prefix.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">Api Key name.</param>
|
||||||
|
/// <param name="value">Api Key value.</param>
|
||||||
|
public void AddApiKeyPrefix(string key, string value)
|
||||||
|
{
|
||||||
|
ApiKeyPrefix[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Methods
|
||||||
|
|
||||||
|
#region Static Members
|
||||||
|
/// <summary>
|
||||||
|
/// Merge configurations.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="first">First configuration.</param>
|
||||||
|
/// <param name="second">Second configuration.</param>
|
||||||
|
/// <return>Merged configuration.</return>
|
||||||
|
public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second)
|
||||||
|
{
|
||||||
|
if (second == null) return first ?? GlobalConfiguration.Instance;
|
||||||
|
|
||||||
|
Dictionary<string, string> apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||||
|
Dictionary<string, string> apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||||
|
Dictionary<string, string> defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||||
|
|
||||||
|
foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value;
|
||||||
|
foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value;
|
||||||
|
foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value;
|
||||||
|
|
||||||
|
var config = new Configuration
|
||||||
|
{
|
||||||
|
ApiKey = apiKey,
|
||||||
|
ApiKeyPrefix = apiKeyPrefix,
|
||||||
|
DefaultHeaders = defaultHeaders,
|
||||||
|
BasePath = second.BasePath ?? first.BasePath,
|
||||||
|
Timeout = second.Timeout,
|
||||||
|
Proxy = second.Proxy ?? first.Proxy,
|
||||||
|
UserAgent = second.UserAgent ?? first.UserAgent,
|
||||||
|
Username = second.Username ?? first.Username,
|
||||||
|
Password = second.Password ?? first.Password,
|
||||||
|
AccessToken = second.AccessToken ?? first.AccessToken,
|
||||||
|
TempFolderPath = second.TempFolderPath ?? first.TempFolderPath,
|
||||||
|
DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat,
|
||||||
|
ClientCertificates = second.ClientCertificates ?? first.ClientCertificates,
|
||||||
|
UseDefaultCredentials = second.UseDefaultCredentials,
|
||||||
|
RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback,
|
||||||
|
};
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
#endregion Static Members
|
||||||
|
}
|
||||||
|
}
|
||||||
23
src/Tribufu.Generated/Client/ExceptionFactory.cs
Normal file
23
src/Tribufu.Generated/Client/ExceptionFactory.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A delegate to ExceptionFactory method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="methodName">Method name</param>
|
||||||
|
/// <param name="response">Response</param>
|
||||||
|
/// <returns>Exceptions</returns>
|
||||||
|
public delegate Exception ExceptionFactory(string methodName, IApiResponse response);
|
||||||
|
}
|
||||||
68
src/Tribufu.Generated/Client/GlobalConfiguration.cs
Normal file
68
src/Tribufu.Generated/Client/GlobalConfiguration.cs
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <see cref="GlobalConfiguration"/> provides a compile-time extension point for globally configuring
|
||||||
|
/// API Clients.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// A customized implementation via partial class may reside in another file and may
|
||||||
|
/// be excluded from automatic generation via a .openapi-generator-ignore file.
|
||||||
|
/// </remarks>
|
||||||
|
public partial class GlobalConfiguration : Configuration
|
||||||
|
{
|
||||||
|
#region Private Members
|
||||||
|
|
||||||
|
private static readonly object GlobalConfigSync = new { };
|
||||||
|
private static IReadableConfiguration _globalConfiguration;
|
||||||
|
|
||||||
|
#endregion Private Members
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
private GlobalConfiguration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public GlobalConfiguration(IDictionary<string, string> defaultHeader, IDictionary<string, string> apiKey, IDictionary<string, string> apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static GlobalConfiguration()
|
||||||
|
{
|
||||||
|
Instance = new GlobalConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the default Configuration.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Configuration.</value>
|
||||||
|
public static IReadableConfiguration Instance
|
||||||
|
{
|
||||||
|
get { return _globalConfiguration; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
lock (GlobalConfigSync)
|
||||||
|
{
|
||||||
|
_globalConfiguration = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
src/Tribufu.Generated/Client/HttpMethod.cs
Normal file
34
src/Tribufu.Generated/Client/HttpMethod.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Http methods supported by swagger
|
||||||
|
/// </summary>
|
||||||
|
public enum HttpMethod
|
||||||
|
{
|
||||||
|
/// <summary>HTTP GET request.</summary>
|
||||||
|
Get,
|
||||||
|
/// <summary>HTTP POST request.</summary>
|
||||||
|
Post,
|
||||||
|
/// <summary>HTTP PUT request.</summary>
|
||||||
|
Put,
|
||||||
|
/// <summary>HTTP DELETE request.</summary>
|
||||||
|
Delete,
|
||||||
|
/// <summary>HTTP HEAD request.</summary>
|
||||||
|
Head,
|
||||||
|
/// <summary>HTTP OPTIONS request.</summary>
|
||||||
|
Options,
|
||||||
|
/// <summary>HTTP PATCH request.</summary>
|
||||||
|
Patch
|
||||||
|
}
|
||||||
|
}
|
||||||
38
src/Tribufu.Generated/Client/IApiAccessor.cs
Normal file
38
src/Tribufu.Generated/Client/IApiAccessor.cs
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents configuration aspects required to interact with the API endpoints.
|
||||||
|
/// </summary>
|
||||||
|
public interface IApiAccessor
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the configuration object
|
||||||
|
/// </summary>
|
||||||
|
/// <value>An instance of the Configuration</value>
|
||||||
|
IReadableConfiguration Configuration { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the base path of the API client.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The base path</value>
|
||||||
|
string GetBasePath();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a factory method hook for the creation of exceptions.
|
||||||
|
/// </summary>
|
||||||
|
ExceptionFactory ExceptionFactory { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
101
src/Tribufu.Generated/Client/IAsynchronousClient.cs
Normal file
101
src/Tribufu.Generated/Client/IAsynchronousClient.cs
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Contract for Asynchronous RESTful API interactions.
|
||||||
|
///
|
||||||
|
/// This interface allows consumers to provide a custom API accessor client.
|
||||||
|
/// </summary>
|
||||||
|
public interface IAsynchronousClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the GET http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the POST http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the PUT http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the DELETE http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the HEAD http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the OPTIONS http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a non-blocking call to some <paramref name="path"/> using the PATCH http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken));
|
||||||
|
}
|
||||||
|
}
|
||||||
142
src/Tribufu.Generated/Client/IReadableConfiguration.cs
Normal file
142
src/Tribufu.Generated/Client/IReadableConfiguration.cs
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Security;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a readable-only configuration contract.
|
||||||
|
/// </summary>
|
||||||
|
public interface IReadableConfiguration
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the access token.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Access token.</value>
|
||||||
|
string AccessToken { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the API key.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>API key.</value>
|
||||||
|
IDictionary<string, string> ApiKey { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the API key prefix.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>API key prefix.</value>
|
||||||
|
IDictionary<string, string> ApiKeyPrefix { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the base path.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Base path.</value>
|
||||||
|
string BasePath { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the date time format.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Date time format.</value>
|
||||||
|
string DateTimeFormat { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the default header.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Default header.</value>
|
||||||
|
[Obsolete("Use DefaultHeaders instead.")]
|
||||||
|
IDictionary<string, string> DefaultHeader { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the default headers.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Default headers.</value>
|
||||||
|
IDictionary<string, string> DefaultHeaders { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the temp folder path.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Temp folder path.</value>
|
||||||
|
string TempFolderPath { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the HTTP connection timeout.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>HTTP connection timeout.</value>
|
||||||
|
TimeSpan Timeout { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the proxy.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Proxy.</value>
|
||||||
|
WebProxy Proxy { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the user agent.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>User agent.</value>
|
||||||
|
string UserAgent { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the username.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Username.</value>
|
||||||
|
string Username { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the password.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Password.</value>
|
||||||
|
string Password { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
|
||||||
|
/// </summary>
|
||||||
|
bool UseDefaultCredentials { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the servers associated with the operation.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>Operation servers.</value>
|
||||||
|
IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the API key with prefix.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
|
||||||
|
/// <returns>API key with prefix.</returns>
|
||||||
|
string GetApiKeyWithPrefix(string apiKeyIdentifier);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the Operation server url at the provided index.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="operation">Operation server name.</param>
|
||||||
|
/// <param name="index">Index of the operation server settings.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
string GetOperationServerUrl(string operation, int index);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets certificate collection to be sent with requests.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>X509 Certificate collection.</value>
|
||||||
|
X509CertificateCollection ClientCertificates { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Callback function for handling the validation of remote certificates. Useful for certificate pinning and
|
||||||
|
/// overriding certificate errors in the scope of a request.
|
||||||
|
/// </summary>
|
||||||
|
RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
94
src/Tribufu.Generated/Client/ISynchronousClient.cs
Normal file
94
src/Tribufu.Generated/Client/ISynchronousClient.cs
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Contract for Synchronous RESTful API interactions.
|
||||||
|
///
|
||||||
|
/// This interface allows consumers to provide a custom API accessor client.
|
||||||
|
/// </summary>
|
||||||
|
public interface ISynchronousClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the GET http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the POST http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the PUT http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the DELETE http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the HEAD http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the OPTIONS http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a blocking call to some <paramref name="path"/> using the PATCH http verb.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path">The relative path to invoke.</param>
|
||||||
|
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||||
|
/// <param name="configuration">Per-request configurable settings.</param>
|
||||||
|
/// <typeparam name="T">The return type.</typeparam>
|
||||||
|
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||||
|
ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||||
|
}
|
||||||
|
}
|
||||||
296
src/Tribufu.Generated/Client/Multimap.cs
Normal file
296
src/Tribufu.Generated/Client/Multimap.cs
Normal file
@@ -0,0 +1,296 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A dictionary in which one key has many associated values.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TKey">The type of the key</typeparam>
|
||||||
|
/// <typeparam name="TValue">The type of the value associated with the key.</typeparam>
|
||||||
|
public class Multimap<TKey, TValue> : IDictionary<TKey, IList<TValue>>
|
||||||
|
{
|
||||||
|
#region Private Fields
|
||||||
|
|
||||||
|
private readonly Dictionary<TKey, IList<TValue>> _dictionary;
|
||||||
|
|
||||||
|
#endregion Private Fields
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Empty Constructor.
|
||||||
|
/// </summary>
|
||||||
|
public Multimap()
|
||||||
|
{
|
||||||
|
_dictionary = new Dictionary<TKey, IList<TValue>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor with comparer.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="comparer"></param>
|
||||||
|
public Multimap(IEqualityComparer<TKey> comparer)
|
||||||
|
{
|
||||||
|
_dictionary = new Dictionary<TKey, IList<TValue>>(comparer);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Constructors
|
||||||
|
|
||||||
|
#region Enumerators
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To get the enumerator.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Enumerator</returns>
|
||||||
|
public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator()
|
||||||
|
{
|
||||||
|
return _dictionary.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To get the enumerator.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Enumerator</returns>
|
||||||
|
IEnumerator IEnumerable.GetEnumerator()
|
||||||
|
{
|
||||||
|
return _dictionary.GetEnumerator();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Enumerators
|
||||||
|
|
||||||
|
#region Public Members
|
||||||
|
/// <summary>
|
||||||
|
/// Add values to Multimap
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">Key value pair</param>
|
||||||
|
public void Add(KeyValuePair<TKey, IList<TValue>> item)
|
||||||
|
{
|
||||||
|
if (!TryAdd(item.Key, item.Value))
|
||||||
|
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add Multimap to Multimap
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="multimap">Multimap</param>
|
||||||
|
public void Add(Multimap<TKey, TValue> multimap)
|
||||||
|
{
|
||||||
|
foreach (var item in multimap)
|
||||||
|
{
|
||||||
|
if (!TryAdd(item.Key, item.Value))
|
||||||
|
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear Multimap
|
||||||
|
/// </summary>
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
_dictionary.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether Multimap contains the specified item.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">Key value pair</param>
|
||||||
|
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||||
|
/// <returns>true if the Multimap contains the item; otherwise, false.</returns>
|
||||||
|
public bool Contains(KeyValuePair<TKey, IList<TValue>> item)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Copy items of the Multimap to an array,
|
||||||
|
/// starting at a particular array index.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="array">The array that is the destination of the items copied
|
||||||
|
/// from Multimap. The array must have zero-based indexing.</param>
|
||||||
|
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
|
||||||
|
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||||
|
public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes the specified item from the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="item">Key value pair</param>
|
||||||
|
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||||
|
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||||
|
public bool Remove(KeyValuePair<TKey, IList<TValue>> item)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the number of items contained in the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
public int Count => _dictionary.Count;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a value indicating whether the Multimap is read-only.
|
||||||
|
/// </summary>
|
||||||
|
public bool IsReadOnly => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds an item with the provided key and value to the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||||
|
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||||
|
/// <exception cref="InvalidOperationException">Thrown when couldn't add the value to Multimap.</exception>
|
||||||
|
public void Add(TKey key, IList<TValue> value)
|
||||||
|
{
|
||||||
|
if (value != null && value.Count > 0)
|
||||||
|
{
|
||||||
|
if (_dictionary.TryGetValue(key, out var list))
|
||||||
|
{
|
||||||
|
foreach (var k in value) list.Add(k);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list = new List<TValue>(value);
|
||||||
|
if (!TryAdd(key, list))
|
||||||
|
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the Multimap contains an item with the specified key.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The key to locate in the Multimap.</param>
|
||||||
|
/// <returns>true if the Multimap contains an item with
|
||||||
|
/// the key; otherwise, false.</returns>
|
||||||
|
public bool ContainsKey(TKey key)
|
||||||
|
{
|
||||||
|
return _dictionary.ContainsKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes item with the specified key from the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The key to locate in the Multimap.</param>
|
||||||
|
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||||
|
public bool Remove(TKey key)
|
||||||
|
{
|
||||||
|
return TryRemove(key, out var _);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the value associated with the specified key.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The key whose value to get.</param>
|
||||||
|
/// <param name="value">When this method returns, the value associated with the specified key, if the
|
||||||
|
/// key is found; otherwise, the default value for the type of the value parameter.
|
||||||
|
/// This parameter is passed uninitialized.</param>
|
||||||
|
/// <returns> true if the object that implements Multimap contains
|
||||||
|
/// an item with the specified key; otherwise, false.</returns>
|
||||||
|
public bool TryGetValue(TKey key, out IList<TValue> value)
|
||||||
|
{
|
||||||
|
return _dictionary.TryGetValue(key, out value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the item with the specified key.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The key of the item to get or set.</param>
|
||||||
|
/// <returns>The value of the specified key.</returns>
|
||||||
|
public IList<TValue> this[TKey key]
|
||||||
|
{
|
||||||
|
get => _dictionary[key];
|
||||||
|
set => _dictionary[key] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
public ICollection<TKey> Keys => _dictionary.Keys;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
public ICollection<IList<TValue>> Values => _dictionary.Values;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Copy the items of the Multimap to an System.Array,
|
||||||
|
/// starting at a particular System.Array index.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="array">The one-dimensional System.Array that is the destination of the items copied
|
||||||
|
/// from Multimap. The System.Array must have zero-based indexing.</param>
|
||||||
|
/// <param name="index">The zero-based index in array at which copying begins.</param>
|
||||||
|
public void CopyTo(Array array, int index)
|
||||||
|
{
|
||||||
|
((ICollection)_dictionary).CopyTo(array, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds an item with the provided key and value to the Multimap.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||||
|
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||||
|
/// <exception cref="InvalidOperationException">Thrown when couldn't add value to Multimap.</exception>
|
||||||
|
public void Add(TKey key, TValue value)
|
||||||
|
{
|
||||||
|
if (value != null)
|
||||||
|
{
|
||||||
|
if (_dictionary.TryGetValue(key, out var list))
|
||||||
|
{
|
||||||
|
list.Add(value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list = new List<TValue> { value };
|
||||||
|
if (!TryAdd(key, list))
|
||||||
|
throw new InvalidOperationException("Could not add value to Multimap.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion Public Members
|
||||||
|
|
||||||
|
#region Private Members
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to encapsulate generator differences between dictionary types.
|
||||||
|
*/
|
||||||
|
private bool TryRemove(TKey key, out IList<TValue> value)
|
||||||
|
{
|
||||||
|
_dictionary.TryGetValue(key, out value);
|
||||||
|
return _dictionary.Remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to encapsulate generator differences between dictionary types.
|
||||||
|
*/
|
||||||
|
private bool TryAdd(TKey key, IList<TValue> value)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_dictionary.Add(key, value);
|
||||||
|
}
|
||||||
|
catch (ArgumentException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endregion Private Members
|
||||||
|
}
|
||||||
|
}
|
||||||
30
src/Tribufu.Generated/Client/OpenAPIDateConverter.cs
Normal file
30
src/Tribufu.Generated/Client/OpenAPIDateConverter.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Formatter for 'date' openapi formats ss defined by full-date - RFC3339
|
||||||
|
/// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types
|
||||||
|
/// </summary>
|
||||||
|
public class OpenAPIDateConverter : IsoDateTimeConverter
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class.
|
||||||
|
/// </summary>
|
||||||
|
public OpenAPIDateConverter()
|
||||||
|
{
|
||||||
|
// full-date = date-fullyear "-" date-month "-" date-mday
|
||||||
|
DateTimeFormat = "yyyy-MM-dd";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
85
src/Tribufu.Generated/Client/RequestOptions.cs
Normal file
85
src/Tribufu.Generated/Client/RequestOptions.cs
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// A container for generalized request inputs. This type allows consumers to extend the request functionality
|
||||||
|
/// by abstracting away from the default (built-in) request framework (e.g. RestSharp).
|
||||||
|
/// </summary>
|
||||||
|
public class RequestOptions
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Parameters to be bound to path parts of the Request's URL
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, string> PathParameters { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Query parameters to be applied to the request.
|
||||||
|
/// Keys may have 1 or more values associated.
|
||||||
|
/// </summary>
|
||||||
|
public Multimap<string, string> QueryParameters { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Header parameters to be applied to the request.
|
||||||
|
/// Keys may have 1 or more values associated.
|
||||||
|
/// </summary>
|
||||||
|
public Multimap<string, string> HeaderParameters { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Form parameters to be sent along with the request.
|
||||||
|
/// </summary>
|
||||||
|
public Dictionary<string, string> FormParameters { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// File parameters to be sent along with the request.
|
||||||
|
/// </summary>
|
||||||
|
public Multimap<string, Stream> FileParameters { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Cookies to be sent along with the request.
|
||||||
|
/// </summary>
|
||||||
|
public List<Cookie> Cookies { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Operation associated with the request path.
|
||||||
|
/// </summary>
|
||||||
|
public string Operation { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Index associated with the operation.
|
||||||
|
/// </summary>
|
||||||
|
public int OperationIndex { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Any data associated with a request body.
|
||||||
|
/// </summary>
|
||||||
|
public Object Data { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructs a new instance of <see cref="RequestOptions"/>
|
||||||
|
/// </summary>
|
||||||
|
public RequestOptions()
|
||||||
|
{
|
||||||
|
PathParameters = new Dictionary<string, string>();
|
||||||
|
QueryParameters = new Multimap<string, string>();
|
||||||
|
HeaderParameters = new Multimap<string, string>();
|
||||||
|
FormParameters = new Dictionary<string, string>();
|
||||||
|
FileParameters = new Multimap<string, Stream>();
|
||||||
|
Cookies = new List<Cookie>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
src/Tribufu.Generated/Client/RetryConfiguration.cs
Normal file
32
src/Tribufu.Generated/Client/RetryConfiguration.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using Polly;
|
||||||
|
using RestSharp;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Client
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Configuration class to set the polly retry policies to be applied to the requests.
|
||||||
|
/// </summary>
|
||||||
|
public static class RetryConfiguration
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Retry policy
|
||||||
|
/// </summary>
|
||||||
|
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Async retry policy
|
||||||
|
/// </summary>
|
||||||
|
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
77
src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs
Normal file
77
src/Tribufu.Generated/Model/AbstractOpenAPISchema.cs
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Serialization;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification
|
||||||
|
/// </summary>
|
||||||
|
public abstract partial class AbstractOpenAPISchema
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Custom JSON serializer
|
||||||
|
/// </summary>
|
||||||
|
static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
// OpenAPI generated types generally hide default constructors.
|
||||||
|
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||||
|
MissingMemberHandling = MissingMemberHandling.Error,
|
||||||
|
ContractResolver = new DefaultContractResolver
|
||||||
|
{
|
||||||
|
NamingStrategy = new CamelCaseNamingStrategy
|
||||||
|
{
|
||||||
|
OverrideSpecifiedNames = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Custom JSON serializer for objects with additional properties
|
||||||
|
/// </summary>
|
||||||
|
static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
// OpenAPI generated types generally hide default constructors.
|
||||||
|
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||||
|
MissingMemberHandling = MissingMemberHandling.Ignore,
|
||||||
|
ContractResolver = new DefaultContractResolver
|
||||||
|
{
|
||||||
|
NamingStrategy = new CamelCaseNamingStrategy
|
||||||
|
{
|
||||||
|
OverrideSpecifiedNames = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the actual instance
|
||||||
|
/// </summary>
|
||||||
|
public abstract Object ActualInstance { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets IsNullable to indicate whether the instance is nullable
|
||||||
|
/// </summary>
|
||||||
|
public bool IsNullable { get; protected set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf`
|
||||||
|
/// </summary>
|
||||||
|
public string SchemaType { get; protected set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Converts the instance into JSON string.
|
||||||
|
/// </summary>
|
||||||
|
public abstract string ToJson();
|
||||||
|
}
|
||||||
|
}
|
||||||
146
src/Tribufu.Generated/Model/Account.cs
Normal file
146
src/Tribufu.Generated/Model/Account.cs
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Account
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Account")]
|
||||||
|
public partial class Account : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Provider
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "provider", EmitDefaultValue = false)]
|
||||||
|
public LoginProvider? Provider { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Account" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="provider">provider.</param>
|
||||||
|
/// <param name="userId">userId.</param>
|
||||||
|
/// <param name="authorized">authorized.</param>
|
||||||
|
/// <param name="fields">fields.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Account(string id = default(string), string name = default(string), LoginProvider? provider = default(LoginProvider?), string userId = default(string), bool authorized = default(bool), Object fields = default(Object), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Provider = provider;
|
||||||
|
this.UserId = userId;
|
||||||
|
this.Authorized = authorized;
|
||||||
|
this.Fields = fields;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = true)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets UserId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "user_id", EmitDefaultValue = false)]
|
||||||
|
public string UserId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Authorized
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "authorized", EmitDefaultValue = true)]
|
||||||
|
public bool Authorized { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Fields
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "fields", EmitDefaultValue = true)]
|
||||||
|
public Object Fields { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Account {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Provider: ").Append(Provider).Append("\n");
|
||||||
|
sb.Append(" UserId: ").Append(UserId).Append("\n");
|
||||||
|
sb.Append(" Authorized: ").Append(Authorized).Append("\n");
|
||||||
|
sb.Append(" Fields: ").Append(Fields).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
284
src/Tribufu.Generated/Model/Application.cs
Normal file
284
src/Tribufu.Generated/Model/Application.cs
Normal file
@@ -0,0 +1,284 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Application
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Application")]
|
||||||
|
public partial class Application : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Type
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||||
|
public ApplicationType? Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Application" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="type">type.</param>
|
||||||
|
/// <param name="organizationId">organizationId.</param>
|
||||||
|
/// <param name="iconUrl">iconUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="capsuleImageUrl">capsuleImageUrl.</param>
|
||||||
|
/// <param name="libraryImageUrl">libraryImageUrl.</param>
|
||||||
|
/// <param name="parentId">parentId.</param>
|
||||||
|
/// <param name="slug">slug.</param>
|
||||||
|
/// <param name="visibility">visibility.</param>
|
||||||
|
/// <param name="password">password.</param>
|
||||||
|
/// <param name="primary">primary.</param>
|
||||||
|
/// <param name="userCount">userCount.</param>
|
||||||
|
/// <param name="achievementCount">achievementCount.</param>
|
||||||
|
/// <param name="badgeCount">badgeCount.</param>
|
||||||
|
/// <param name="downloadCount">downloadCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Application(string id = default(string), string name = default(string), string description = default(string), ApplicationType? type = default(ApplicationType?), string organizationId = default(string), string iconUrl = default(string), string bannerUrl = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string parentId = default(string), string slug = default(string), int visibility = default(int), string password = default(string), int primary = default(int), int userCount = default(int), int achievementCount = default(int), int? badgeCount = default(int?), int downloadCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Description = description;
|
||||||
|
this.Type = type;
|
||||||
|
this.OrganizationId = organizationId;
|
||||||
|
this.IconUrl = iconUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.CapsuleImageUrl = capsuleImageUrl;
|
||||||
|
this.LibraryImageUrl = libraryImageUrl;
|
||||||
|
this.ParentId = parentId;
|
||||||
|
this.Slug = slug;
|
||||||
|
this.Visibility = visibility;
|
||||||
|
this.Password = password;
|
||||||
|
this.Primary = primary;
|
||||||
|
this.UserCount = userCount;
|
||||||
|
this.AchievementCount = achievementCount;
|
||||||
|
this.BadgeCount = badgeCount;
|
||||||
|
this.DownloadCount = downloadCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets OrganizationId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "organization_id", EmitDefaultValue = true)]
|
||||||
|
public string OrganizationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets IconUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "icon_url", EmitDefaultValue = true)]
|
||||||
|
public string IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CapsuleImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "capsule_image_url", EmitDefaultValue = true)]
|
||||||
|
public string CapsuleImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LibraryImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "library_image_url", EmitDefaultValue = true)]
|
||||||
|
public string LibraryImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ParentId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "parent_id", EmitDefaultValue = true)]
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Slug
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "slug", EmitDefaultValue = true)]
|
||||||
|
public string Slug { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Visibility
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "visibility", EmitDefaultValue = false)]
|
||||||
|
public int Visibility { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Password
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "password", EmitDefaultValue = true)]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Primary
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "primary", EmitDefaultValue = false)]
|
||||||
|
public int Primary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets UserCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "user_count", EmitDefaultValue = false)]
|
||||||
|
public int UserCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets AchievementCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "achievement_count", EmitDefaultValue = false)]
|
||||||
|
public int AchievementCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BadgeCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "badge_count", EmitDefaultValue = true)]
|
||||||
|
public int? BadgeCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DownloadCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "download_count", EmitDefaultValue = false)]
|
||||||
|
public int DownloadCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Application {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||||
|
sb.Append(" OrganizationId: ").Append(OrganizationId).Append("\n");
|
||||||
|
sb.Append(" IconUrl: ").Append(IconUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
|
||||||
|
sb.Append(" LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
|
||||||
|
sb.Append(" ParentId: ").Append(ParentId).Append("\n");
|
||||||
|
sb.Append(" Slug: ").Append(Slug).Append("\n");
|
||||||
|
sb.Append(" Visibility: ").Append(Visibility).Append("\n");
|
||||||
|
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||||
|
sb.Append(" Primary: ").Append(Primary).Append("\n");
|
||||||
|
sb.Append(" UserCount: ").Append(UserCount).Append("\n");
|
||||||
|
sb.Append(" AchievementCount: ").Append(AchievementCount).Append("\n");
|
||||||
|
sb.Append(" BadgeCount: ").Append(BadgeCount).Append("\n");
|
||||||
|
sb.Append(" DownloadCount: ").Append(DownloadCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 75)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// IconUrl (string) maxLength
|
||||||
|
if (this.IconUrl != null && this.IconUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for IconUrl, length must be less than 255.", new [] { "IconUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// BannerUrl (string) maxLength
|
||||||
|
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapsuleImageUrl (string) maxLength
|
||||||
|
if (this.CapsuleImageUrl != null && this.CapsuleImageUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for CapsuleImageUrl, length must be less than 255.", new [] { "CapsuleImageUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// LibraryImageUrl (string) maxLength
|
||||||
|
if (this.LibraryImageUrl != null && this.LibraryImageUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for LibraryImageUrl, length must be less than 255.", new [] { "LibraryImageUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/Tribufu.Generated/Model/ApplicationType.cs
Normal file
48
src/Tribufu.Generated/Model/ApplicationType.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines ApplicationType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum ApplicationType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Application for value: application
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "application")]
|
||||||
|
Application,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Game for value: game
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "game")]
|
||||||
|
Game
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
137
src/Tribufu.Generated/Model/AuthorizeRequest.cs
Normal file
137
src/Tribufu.Generated/Model/AuthorizeRequest.cs
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// AuthorizeRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "AuthorizeRequest")]
|
||||||
|
public partial class AuthorizeRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ResponseType
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "response_type", EmitDefaultValue = false)]
|
||||||
|
public ResponseType? ResponseType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CodeChallengeMethod
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "code_challenge_method", EmitDefaultValue = false)]
|
||||||
|
public CodeChallengeMethod? CodeChallengeMethod { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="AuthorizeRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="responseType">responseType.</param>
|
||||||
|
/// <param name="clientId">clientId.</param>
|
||||||
|
/// <param name="codeChallenge">codeChallenge.</param>
|
||||||
|
/// <param name="codeChallengeMethod">codeChallengeMethod.</param>
|
||||||
|
/// <param name="redirectUri">redirectUri.</param>
|
||||||
|
/// <param name="scope">scope.</param>
|
||||||
|
/// <param name="state">state.</param>
|
||||||
|
public AuthorizeRequest(ResponseType? responseType = default(ResponseType?), string clientId = default(string), string codeChallenge = default(string), CodeChallengeMethod? codeChallengeMethod = default(CodeChallengeMethod?), string redirectUri = default(string), string scope = default(string), string state = default(string))
|
||||||
|
{
|
||||||
|
this.ResponseType = responseType;
|
||||||
|
this.ClientId = clientId;
|
||||||
|
this.CodeChallenge = codeChallenge;
|
||||||
|
this.CodeChallengeMethod = codeChallengeMethod;
|
||||||
|
this.RedirectUri = redirectUri;
|
||||||
|
this.Scope = scope;
|
||||||
|
this.State = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ClientId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "client_id", EmitDefaultValue = true)]
|
||||||
|
public string ClientId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CodeChallenge
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "code_challenge", EmitDefaultValue = true)]
|
||||||
|
public string CodeChallenge { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RedirectUri
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "redirect_uri", EmitDefaultValue = true)]
|
||||||
|
public string RedirectUri { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Scope
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "scope", EmitDefaultValue = true)]
|
||||||
|
public string Scope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets State
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "state", EmitDefaultValue = true)]
|
||||||
|
public string State { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class AuthorizeRequest {\n");
|
||||||
|
sb.Append(" ResponseType: ").Append(ResponseType).Append("\n");
|
||||||
|
sb.Append(" ClientId: ").Append(ClientId).Append("\n");
|
||||||
|
sb.Append(" CodeChallenge: ").Append(CodeChallenge).Append("\n");
|
||||||
|
sb.Append(" CodeChallengeMethod: ").Append(CodeChallengeMethod).Append("\n");
|
||||||
|
sb.Append(" RedirectUri: ").Append(RedirectUri).Append("\n");
|
||||||
|
sb.Append(" Scope: ").Append(Scope).Append("\n");
|
||||||
|
sb.Append(" State: ").Append(State).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/Tribufu.Generated/Model/CodeChallengeMethod.cs
Normal file
48
src/Tribufu.Generated/Model/CodeChallengeMethod.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines CodeChallengeMethod
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum CodeChallengeMethod
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Plain for value: plain
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "plain")]
|
||||||
|
Plain,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum S256 for value: S256
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "S256")]
|
||||||
|
S256
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
92
src/Tribufu.Generated/Model/CryptoViewModel.cs
Normal file
92
src/Tribufu.Generated/Model/CryptoViewModel.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// CryptoViewModel
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "CryptoViewModel")]
|
||||||
|
public partial class CryptoViewModel : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="CryptoViewModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="encoded">encoded.</param>
|
||||||
|
/// <param name="decoded">decoded.</param>
|
||||||
|
public CryptoViewModel(string encoded = default(string), string decoded = default(string))
|
||||||
|
{
|
||||||
|
this.Encoded = encoded;
|
||||||
|
this.Decoded = decoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Encoded
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "encoded", EmitDefaultValue = true)]
|
||||||
|
public string Encoded { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Decoded
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "decoded", EmitDefaultValue = true)]
|
||||||
|
public string Decoded { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class CryptoViewModel {\n");
|
||||||
|
sb.Append(" Encoded: ").Append(Encoded).Append("\n");
|
||||||
|
sb.Append(" Decoded: ").Append(Decoded).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
401
src/Tribufu.Generated/Model/Game.cs
Normal file
401
src/Tribufu.Generated/Model/Game.cs
Normal file
@@ -0,0 +1,401 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Game
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Game")]
|
||||||
|
public partial class Game : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Type
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||||
|
public ApplicationType? Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Game" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="gamePort">gamePort.</param>
|
||||||
|
/// <param name="queryPort">queryPort.</param>
|
||||||
|
/// <param name="rconPort">rconPort.</param>
|
||||||
|
/// <param name="serverCount">serverCount.</param>
|
||||||
|
/// <param name="steamAppId">steamAppId.</param>
|
||||||
|
/// <param name="steamServerAppId">steamServerAppId.</param>
|
||||||
|
/// <param name="enableServers">enableServers.</param>
|
||||||
|
/// <param name="rustGamedigId">rustGamedigId.</param>
|
||||||
|
/// <param name="nodeGamedigId">nodeGamedigId.</param>
|
||||||
|
/// <param name="serverConnectUrl">serverConnectUrl.</param>
|
||||||
|
/// <param name="serverTags">serverTags.</param>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="type">type.</param>
|
||||||
|
/// <param name="organizationId">organizationId.</param>
|
||||||
|
/// <param name="iconUrl">iconUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="capsuleImageUrl">capsuleImageUrl.</param>
|
||||||
|
/// <param name="libraryImageUrl">libraryImageUrl.</param>
|
||||||
|
/// <param name="parentId">parentId.</param>
|
||||||
|
/// <param name="slug">slug.</param>
|
||||||
|
/// <param name="visibility">visibility.</param>
|
||||||
|
/// <param name="password">password.</param>
|
||||||
|
/// <param name="primary">primary.</param>
|
||||||
|
/// <param name="userCount">userCount.</param>
|
||||||
|
/// <param name="achievementCount">achievementCount.</param>
|
||||||
|
/// <param name="badgeCount">badgeCount.</param>
|
||||||
|
/// <param name="downloadCount">downloadCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Game(int? gamePort = default(int?), int? queryPort = default(int?), int? rconPort = default(int?), int serverCount = default(int), int? steamAppId = default(int?), int? steamServerAppId = default(int?), bool enableServers = default(bool), string rustGamedigId = default(string), string nodeGamedigId = default(string), string serverConnectUrl = default(string), string serverTags = default(string), string id = default(string), string name = default(string), string description = default(string), ApplicationType? type = default(ApplicationType?), string organizationId = default(string), string iconUrl = default(string), string bannerUrl = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string parentId = default(string), string slug = default(string), int visibility = default(int), string password = default(string), int primary = default(int), int userCount = default(int), int achievementCount = default(int), int? badgeCount = default(int?), int downloadCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.GamePort = gamePort;
|
||||||
|
this.QueryPort = queryPort;
|
||||||
|
this.RconPort = rconPort;
|
||||||
|
this.ServerCount = serverCount;
|
||||||
|
this.SteamAppId = steamAppId;
|
||||||
|
this.SteamServerAppId = steamServerAppId;
|
||||||
|
this.EnableServers = enableServers;
|
||||||
|
this.RustGamedigId = rustGamedigId;
|
||||||
|
this.NodeGamedigId = nodeGamedigId;
|
||||||
|
this.ServerConnectUrl = serverConnectUrl;
|
||||||
|
this.ServerTags = serverTags;
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Description = description;
|
||||||
|
this.Type = type;
|
||||||
|
this.OrganizationId = organizationId;
|
||||||
|
this.IconUrl = iconUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.CapsuleImageUrl = capsuleImageUrl;
|
||||||
|
this.LibraryImageUrl = libraryImageUrl;
|
||||||
|
this.ParentId = parentId;
|
||||||
|
this.Slug = slug;
|
||||||
|
this.Visibility = visibility;
|
||||||
|
this.Password = password;
|
||||||
|
this.Primary = primary;
|
||||||
|
this.UserCount = userCount;
|
||||||
|
this.AchievementCount = achievementCount;
|
||||||
|
this.BadgeCount = badgeCount;
|
||||||
|
this.DownloadCount = downloadCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GamePort
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "game_port", EmitDefaultValue = true)]
|
||||||
|
public int? GamePort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets QueryPort
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "query_port", EmitDefaultValue = true)]
|
||||||
|
public int? QueryPort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RconPort
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "rcon_port", EmitDefaultValue = true)]
|
||||||
|
public int? RconPort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ServerCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "server_count", EmitDefaultValue = false)]
|
||||||
|
public int ServerCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets SteamAppId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "steam_app_id", EmitDefaultValue = true)]
|
||||||
|
public int? SteamAppId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets SteamServerAppId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "steam_server_app_id", EmitDefaultValue = true)]
|
||||||
|
public int? SteamServerAppId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets EnableServers
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "enable_servers", EmitDefaultValue = true)]
|
||||||
|
public bool EnableServers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RustGamedigId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "rust_gamedig_id", EmitDefaultValue = true)]
|
||||||
|
public string RustGamedigId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets NodeGamedigId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "node_gamedig_id", EmitDefaultValue = true)]
|
||||||
|
public string NodeGamedigId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ServerConnectUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "server_connect_url", EmitDefaultValue = true)]
|
||||||
|
public string ServerConnectUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ServerTags
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "server_tags", EmitDefaultValue = true)]
|
||||||
|
public string ServerTags { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets OrganizationId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "organization_id", EmitDefaultValue = true)]
|
||||||
|
public string OrganizationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets IconUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "icon_url", EmitDefaultValue = true)]
|
||||||
|
public string IconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CapsuleImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "capsule_image_url", EmitDefaultValue = true)]
|
||||||
|
public string CapsuleImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LibraryImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "library_image_url", EmitDefaultValue = true)]
|
||||||
|
public string LibraryImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ParentId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "parent_id", EmitDefaultValue = true)]
|
||||||
|
public string ParentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Slug
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "slug", EmitDefaultValue = true)]
|
||||||
|
public string Slug { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Visibility
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "visibility", EmitDefaultValue = false)]
|
||||||
|
public int Visibility { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Password
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "password", EmitDefaultValue = true)]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Primary
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "primary", EmitDefaultValue = false)]
|
||||||
|
public int Primary { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets UserCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "user_count", EmitDefaultValue = false)]
|
||||||
|
public int UserCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets AchievementCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "achievement_count", EmitDefaultValue = false)]
|
||||||
|
public int AchievementCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BadgeCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "badge_count", EmitDefaultValue = true)]
|
||||||
|
public int? BadgeCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DownloadCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "download_count", EmitDefaultValue = false)]
|
||||||
|
public int DownloadCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Game {\n");
|
||||||
|
sb.Append(" GamePort: ").Append(GamePort).Append("\n");
|
||||||
|
sb.Append(" QueryPort: ").Append(QueryPort).Append("\n");
|
||||||
|
sb.Append(" RconPort: ").Append(RconPort).Append("\n");
|
||||||
|
sb.Append(" ServerCount: ").Append(ServerCount).Append("\n");
|
||||||
|
sb.Append(" SteamAppId: ").Append(SteamAppId).Append("\n");
|
||||||
|
sb.Append(" SteamServerAppId: ").Append(SteamServerAppId).Append("\n");
|
||||||
|
sb.Append(" EnableServers: ").Append(EnableServers).Append("\n");
|
||||||
|
sb.Append(" RustGamedigId: ").Append(RustGamedigId).Append("\n");
|
||||||
|
sb.Append(" NodeGamedigId: ").Append(NodeGamedigId).Append("\n");
|
||||||
|
sb.Append(" ServerConnectUrl: ").Append(ServerConnectUrl).Append("\n");
|
||||||
|
sb.Append(" ServerTags: ").Append(ServerTags).Append("\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||||
|
sb.Append(" OrganizationId: ").Append(OrganizationId).Append("\n");
|
||||||
|
sb.Append(" IconUrl: ").Append(IconUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
|
||||||
|
sb.Append(" LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
|
||||||
|
sb.Append(" ParentId: ").Append(ParentId).Append("\n");
|
||||||
|
sb.Append(" Slug: ").Append(Slug).Append("\n");
|
||||||
|
sb.Append(" Visibility: ").Append(Visibility).Append("\n");
|
||||||
|
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||||
|
sb.Append(" Primary: ").Append(Primary).Append("\n");
|
||||||
|
sb.Append(" UserCount: ").Append(UserCount).Append("\n");
|
||||||
|
sb.Append(" AchievementCount: ").Append(AchievementCount).Append("\n");
|
||||||
|
sb.Append(" BadgeCount: ").Append(BadgeCount).Append("\n");
|
||||||
|
sb.Append(" DownloadCount: ").Append(DownloadCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// RustGamedigId (string) maxLength
|
||||||
|
if (this.RustGamedigId != null && this.RustGamedigId.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for RustGamedigId, length must be less than 45.", new [] { "RustGamedigId" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// NodeGamedigId (string) maxLength
|
||||||
|
if (this.NodeGamedigId != null && this.NodeGamedigId.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for NodeGamedigId, length must be less than 45.", new [] { "NodeGamedigId" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// ServerConnectUrl (string) maxLength
|
||||||
|
if (this.ServerConnectUrl != null && this.ServerConnectUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for ServerConnectUrl, length must be less than 255.", new [] { "ServerConnectUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 75)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// IconUrl (string) maxLength
|
||||||
|
if (this.IconUrl != null && this.IconUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for IconUrl, length must be less than 255.", new [] { "IconUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// BannerUrl (string) maxLength
|
||||||
|
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapsuleImageUrl (string) maxLength
|
||||||
|
if (this.CapsuleImageUrl != null && this.CapsuleImageUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for CapsuleImageUrl, length must be less than 255.", new [] { "CapsuleImageUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// LibraryImageUrl (string) maxLength
|
||||||
|
if (this.LibraryImageUrl != null && this.LibraryImageUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for LibraryImageUrl, length must be less than 255.", new [] { "LibraryImageUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
407
src/Tribufu.Generated/Model/GameServer.cs
Normal file
407
src/Tribufu.Generated/Model/GameServer.cs
Normal file
@@ -0,0 +1,407 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// GameServer
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "GameServer")]
|
||||||
|
public partial class GameServer : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Status
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "status", EmitDefaultValue = false)]
|
||||||
|
public ServerStatus? Status { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="GameServer" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="address">address.</param>
|
||||||
|
/// <param name="gamePort">gamePort.</param>
|
||||||
|
/// <param name="queryPort">queryPort.</param>
|
||||||
|
/// <param name="gameId">gameId.</param>
|
||||||
|
/// <param name="gameIconUrl">gameIconUrl.</param>
|
||||||
|
/// <param name="varVersion">varVersion.</param>
|
||||||
|
/// <param name="featured">featured.</param>
|
||||||
|
/// <param name="clusterId">clusterId.</param>
|
||||||
|
/// <param name="websiteUrl">websiteUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="ownerId">ownerId.</param>
|
||||||
|
/// <param name="uptime">uptime.</param>
|
||||||
|
/// <param name="status">status.</param>
|
||||||
|
/// <param name="ping">ping.</param>
|
||||||
|
/// <param name="map">map.</param>
|
||||||
|
/// <param name="usedSlots">usedSlots.</param>
|
||||||
|
/// <param name="maxSlots">maxSlots.</param>
|
||||||
|
/// <param name="motd">motd.</param>
|
||||||
|
/// <param name="players">players.</param>
|
||||||
|
/// <param name="lastOnline">lastOnline.</param>
|
||||||
|
/// <param name="country">country.</param>
|
||||||
|
/// <param name="steam">steam.</param>
|
||||||
|
/// <param name="discordServerId">discordServerId.</param>
|
||||||
|
/// <param name="youtubeVideoUrl">youtubeVideoUrl.</param>
|
||||||
|
/// <param name="tags">tags.</param>
|
||||||
|
/// <param name="commentCount">commentCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public GameServer(string id = default(string), string name = default(string), string description = default(string), string address = default(string), int? gamePort = default(int?), int queryPort = default(int), string gameId = default(string), string gameIconUrl = default(string), string varVersion = default(string), bool featured = default(bool), string clusterId = default(string), string websiteUrl = default(string), string bannerUrl = default(string), string ownerId = default(string), double uptime = default(double), ServerStatus? status = default(ServerStatus?), int? ping = default(int?), string map = default(string), int? usedSlots = default(int?), int? maxSlots = default(int?), string motd = default(string), string players = default(string), DateTime? lastOnline = default(DateTime?), string country = default(string), bool steam = default(bool), string discordServerId = default(string), string youtubeVideoUrl = default(string), string tags = default(string), int commentCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Description = description;
|
||||||
|
this.Address = address;
|
||||||
|
this.GamePort = gamePort;
|
||||||
|
this.QueryPort = queryPort;
|
||||||
|
this.GameId = gameId;
|
||||||
|
this.GameIconUrl = gameIconUrl;
|
||||||
|
this.VarVersion = varVersion;
|
||||||
|
this.Featured = featured;
|
||||||
|
this.ClusterId = clusterId;
|
||||||
|
this.WebsiteUrl = websiteUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.OwnerId = ownerId;
|
||||||
|
this.Uptime = uptime;
|
||||||
|
this.Status = status;
|
||||||
|
this.Ping = ping;
|
||||||
|
this.Map = map;
|
||||||
|
this.UsedSlots = usedSlots;
|
||||||
|
this.MaxSlots = maxSlots;
|
||||||
|
this.Motd = motd;
|
||||||
|
this.Players = players;
|
||||||
|
this.LastOnline = lastOnline;
|
||||||
|
this.Country = country;
|
||||||
|
this.Steam = steam;
|
||||||
|
this.DiscordServerId = discordServerId;
|
||||||
|
this.YoutubeVideoUrl = youtubeVideoUrl;
|
||||||
|
this.Tags = tags;
|
||||||
|
this.CommentCount = commentCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Address
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "address", EmitDefaultValue = true)]
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GamePort
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "game_port", EmitDefaultValue = true)]
|
||||||
|
public int? GamePort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets QueryPort
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "query_port", EmitDefaultValue = false)]
|
||||||
|
public int QueryPort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GameId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "game_id", EmitDefaultValue = false)]
|
||||||
|
public string GameId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GameIconUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "game_icon_url", EmitDefaultValue = true)]
|
||||||
|
public string GameIconUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets VarVersion
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "version", EmitDefaultValue = true)]
|
||||||
|
public string VarVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Featured
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "featured", EmitDefaultValue = true)]
|
||||||
|
public bool Featured { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ClusterId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "cluster_id", EmitDefaultValue = true)]
|
||||||
|
public string ClusterId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets WebsiteUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "website_url", EmitDefaultValue = true)]
|
||||||
|
public string WebsiteUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets OwnerId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "owner_id", EmitDefaultValue = true)]
|
||||||
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uptime
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uptime", EmitDefaultValue = false)]
|
||||||
|
public double Uptime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Ping
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "ping", EmitDefaultValue = true)]
|
||||||
|
public int? Ping { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Map
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "map", EmitDefaultValue = true)]
|
||||||
|
public string Map { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets UsedSlots
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "used_slots", EmitDefaultValue = true)]
|
||||||
|
public int? UsedSlots { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets MaxSlots
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "max_slots", EmitDefaultValue = true)]
|
||||||
|
public int? MaxSlots { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Motd
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "motd", EmitDefaultValue = true)]
|
||||||
|
public string Motd { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Players
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "players", EmitDefaultValue = true)]
|
||||||
|
public string Players { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastOnline
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_online", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastOnline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Country
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "country", EmitDefaultValue = true)]
|
||||||
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Steam
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "steam", EmitDefaultValue = true)]
|
||||||
|
public bool Steam { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DiscordServerId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "discord_server_id", EmitDefaultValue = true)]
|
||||||
|
public string DiscordServerId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets YoutubeVideoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "youtube_video_url", EmitDefaultValue = true)]
|
||||||
|
public string YoutubeVideoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Tags
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "tags", EmitDefaultValue = true)]
|
||||||
|
public string Tags { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CommentCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "comment_count", EmitDefaultValue = false)]
|
||||||
|
public int CommentCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class GameServer {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" Address: ").Append(Address).Append("\n");
|
||||||
|
sb.Append(" GamePort: ").Append(GamePort).Append("\n");
|
||||||
|
sb.Append(" QueryPort: ").Append(QueryPort).Append("\n");
|
||||||
|
sb.Append(" GameId: ").Append(GameId).Append("\n");
|
||||||
|
sb.Append(" GameIconUrl: ").Append(GameIconUrl).Append("\n");
|
||||||
|
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
|
||||||
|
sb.Append(" Featured: ").Append(Featured).Append("\n");
|
||||||
|
sb.Append(" ClusterId: ").Append(ClusterId).Append("\n");
|
||||||
|
sb.Append(" WebsiteUrl: ").Append(WebsiteUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
|
||||||
|
sb.Append(" Uptime: ").Append(Uptime).Append("\n");
|
||||||
|
sb.Append(" Status: ").Append(Status).Append("\n");
|
||||||
|
sb.Append(" Ping: ").Append(Ping).Append("\n");
|
||||||
|
sb.Append(" Map: ").Append(Map).Append("\n");
|
||||||
|
sb.Append(" UsedSlots: ").Append(UsedSlots).Append("\n");
|
||||||
|
sb.Append(" MaxSlots: ").Append(MaxSlots).Append("\n");
|
||||||
|
sb.Append(" Motd: ").Append(Motd).Append("\n");
|
||||||
|
sb.Append(" Players: ").Append(Players).Append("\n");
|
||||||
|
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
|
||||||
|
sb.Append(" Country: ").Append(Country).Append("\n");
|
||||||
|
sb.Append(" Steam: ").Append(Steam).Append("\n");
|
||||||
|
sb.Append(" DiscordServerId: ").Append(DiscordServerId).Append("\n");
|
||||||
|
sb.Append(" YoutubeVideoUrl: ").Append(YoutubeVideoUrl).Append("\n");
|
||||||
|
sb.Append(" Tags: ").Append(Tags).Append("\n");
|
||||||
|
sb.Append(" CommentCount: ").Append(CommentCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 75)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Address (string) maxLength
|
||||||
|
if (this.Address != null && this.Address.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Address, length must be less than 255.", new [] { "Address" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// VarVersion (string) maxLength
|
||||||
|
if (this.VarVersion != null && this.VarVersion.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for VarVersion, length must be less than 45.", new [] { "VarVersion" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebsiteUrl (string) maxLength
|
||||||
|
if (this.WebsiteUrl != null && this.WebsiteUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for WebsiteUrl, length must be less than 255.", new [] { "WebsiteUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// BannerUrl (string) maxLength
|
||||||
|
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Map (string) maxLength
|
||||||
|
if (this.Map != null && this.Map.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Map, length must be less than 45.", new [] { "Map" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Motd (string) maxLength
|
||||||
|
if (this.Motd != null && this.Motd.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Motd, length must be less than 255.", new [] { "Motd" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Country (string) maxLength
|
||||||
|
if (this.Country != null && this.Country.Length > 2)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Country, length must be less than 2.", new [] { "Country" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// YoutubeVideoUrl (string) maxLength
|
||||||
|
if (this.YoutubeVideoUrl != null && this.YoutubeVideoUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for YoutubeVideoUrl, length must be less than 255.", new [] { "YoutubeVideoUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
224
src/Tribufu.Generated/Model/GameServerCluster.cs
Normal file
224
src/Tribufu.Generated/Model/GameServerCluster.cs
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// GameServerCluster
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "GameServerCluster")]
|
||||||
|
public partial class GameServerCluster : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="GameServerCluster" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="gameId">gameId.</param>
|
||||||
|
/// <param name="websiteUrl">websiteUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="ownerId">ownerId.</param>
|
||||||
|
/// <param name="discordServerId">discordServerId.</param>
|
||||||
|
/// <param name="youtubeVideoUrl">youtubeVideoUrl.</param>
|
||||||
|
/// <param name="tags">tags.</param>
|
||||||
|
/// <param name="commentCount">commentCount.</param>
|
||||||
|
/// <param name="serverCount">serverCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public GameServerCluster(string id = default(string), string name = default(string), string description = default(string), string gameId = default(string), string websiteUrl = default(string), string bannerUrl = default(string), string ownerId = default(string), string discordServerId = default(string), string youtubeVideoUrl = default(string), string tags = default(string), int commentCount = default(int), int serverCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Description = description;
|
||||||
|
this.GameId = gameId;
|
||||||
|
this.WebsiteUrl = websiteUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.OwnerId = ownerId;
|
||||||
|
this.DiscordServerId = discordServerId;
|
||||||
|
this.YoutubeVideoUrl = youtubeVideoUrl;
|
||||||
|
this.Tags = tags;
|
||||||
|
this.CommentCount = commentCount;
|
||||||
|
this.ServerCount = serverCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GameId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "game_id", EmitDefaultValue = false)]
|
||||||
|
public string GameId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets WebsiteUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "website_url", EmitDefaultValue = true)]
|
||||||
|
public string WebsiteUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets OwnerId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "owner_id", EmitDefaultValue = false)]
|
||||||
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DiscordServerId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "discord_server_id", EmitDefaultValue = true)]
|
||||||
|
public string DiscordServerId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets YoutubeVideoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "youtube_video_url", EmitDefaultValue = true)]
|
||||||
|
public string YoutubeVideoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Tags
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "tags", EmitDefaultValue = true)]
|
||||||
|
public string Tags { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CommentCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "comment_count", EmitDefaultValue = false)]
|
||||||
|
public int CommentCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ServerCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "server_count", EmitDefaultValue = false)]
|
||||||
|
public int ServerCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class GameServerCluster {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" GameId: ").Append(GameId).Append("\n");
|
||||||
|
sb.Append(" WebsiteUrl: ").Append(WebsiteUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
|
||||||
|
sb.Append(" DiscordServerId: ").Append(DiscordServerId).Append("\n");
|
||||||
|
sb.Append(" YoutubeVideoUrl: ").Append(YoutubeVideoUrl).Append("\n");
|
||||||
|
sb.Append(" Tags: ").Append(Tags).Append("\n");
|
||||||
|
sb.Append(" CommentCount: ").Append(CommentCount).Append("\n");
|
||||||
|
sb.Append(" ServerCount: ").Append(ServerCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 75)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebsiteUrl (string) maxLength
|
||||||
|
if (this.WebsiteUrl != null && this.WebsiteUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for WebsiteUrl, length must be less than 255.", new [] { "WebsiteUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// BannerUrl (string) maxLength
|
||||||
|
if (this.BannerUrl != null && this.BannerUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// YoutubeVideoUrl (string) maxLength
|
||||||
|
if (this.YoutubeVideoUrl != null && this.YoutubeVideoUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for YoutubeVideoUrl, length must be less than 255.", new [] { "YoutubeVideoUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
60
src/Tribufu.Generated/Model/GrantType.cs
Normal file
60
src/Tribufu.Generated/Model/GrantType.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines GrantType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum GrantType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum AuthorizationCode for value: authorization_code
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "authorization_code")]
|
||||||
|
AuthorizationCode,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum ClientCredentials for value: client_credentials
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "client_credentials")]
|
||||||
|
ClientCredentials,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Password for value: password
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "password")]
|
||||||
|
Password,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum RefreshToken for value: refresh_token
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "refresh_token")]
|
||||||
|
RefreshToken
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
218
src/Tribufu.Generated/Model/Group.cs
Normal file
218
src/Tribufu.Generated/Model/Group.cs
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Group
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Group")]
|
||||||
|
public partial class Group : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Group" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="uuid">uuid.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="tag">tag.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="type">type.</param>
|
||||||
|
/// <param name="privacy">privacy.</param>
|
||||||
|
/// <param name="ownerId">ownerId.</param>
|
||||||
|
/// <param name="verified">verified.</param>
|
||||||
|
/// <param name="photoUrl">photoUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="memberCount">memberCount.</param>
|
||||||
|
/// <param name="followerCount">followerCount.</param>
|
||||||
|
/// <param name="viewCount">viewCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Group(string id = default(string), Guid uuid = default(Guid), string name = default(string), string tag = default(string), string description = default(string), int type = default(int), int privacy = default(int), string ownerId = default(string), bool verified = default(bool), string photoUrl = default(string), string bannerUrl = default(string), int memberCount = default(int), int followerCount = default(int), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Uuid = uuid;
|
||||||
|
this.Name = name;
|
||||||
|
this.Tag = tag;
|
||||||
|
this.Description = description;
|
||||||
|
this.Type = type;
|
||||||
|
this.Privacy = privacy;
|
||||||
|
this.OwnerId = ownerId;
|
||||||
|
this.Verified = verified;
|
||||||
|
this.PhotoUrl = photoUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.MemberCount = memberCount;
|
||||||
|
this.FollowerCount = followerCount;
|
||||||
|
this.ViewCount = viewCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uuid
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uuid", EmitDefaultValue = false)]
|
||||||
|
public Guid Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Tag
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "tag", EmitDefaultValue = true)]
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Type
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||||
|
public int Type { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Privacy
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "privacy", EmitDefaultValue = false)]
|
||||||
|
public int Privacy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets OwnerId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "owner_id", EmitDefaultValue = false)]
|
||||||
|
public string OwnerId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Verified
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "verified", EmitDefaultValue = true)]
|
||||||
|
public bool Verified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
|
||||||
|
public string PhotoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets MemberCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "member_count", EmitDefaultValue = false)]
|
||||||
|
public int MemberCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets FollowerCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "follower_count", EmitDefaultValue = false)]
|
||||||
|
public int FollowerCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ViewCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "view_count", EmitDefaultValue = false)]
|
||||||
|
public int ViewCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Group {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Tag: ").Append(Tag).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||||
|
sb.Append(" Privacy: ").Append(Privacy).Append("\n");
|
||||||
|
sb.Append(" OwnerId: ").Append(OwnerId).Append("\n");
|
||||||
|
sb.Append(" Verified: ").Append(Verified).Append("\n");
|
||||||
|
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" MemberCount: ").Append(MemberCount).Append("\n");
|
||||||
|
sb.Append(" FollowerCount: ").Append(FollowerCount).Append("\n");
|
||||||
|
sb.Append(" ViewCount: ").Append(ViewCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
137
src/Tribufu.Generated/Model/GroupGame.cs
Normal file
137
src/Tribufu.Generated/Model/GroupGame.cs
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// GroupGame
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "GroupGame")]
|
||||||
|
public partial class GroupGame : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="GroupGame" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="groupId">groupId.</param>
|
||||||
|
/// <param name="group">group.</param>
|
||||||
|
/// <param name="applicationId">applicationId.</param>
|
||||||
|
/// <param name="application">application.</param>
|
||||||
|
/// <param name="stats">stats.</param>
|
||||||
|
/// <param name="acquired">acquired.</param>
|
||||||
|
/// <param name="lastUsed">lastUsed.</param>
|
||||||
|
public GroupGame(string groupId = default(string), Group group = default(Group), string applicationId = default(string), Application application = default(Application), Object stats = default(Object), DateTime acquired = default(DateTime), DateTime? lastUsed = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.GroupId = groupId;
|
||||||
|
this.Group = group;
|
||||||
|
this.ApplicationId = applicationId;
|
||||||
|
this.Application = application;
|
||||||
|
this.Stats = stats;
|
||||||
|
this.Acquired = acquired;
|
||||||
|
this.LastUsed = lastUsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GroupId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "group_id", EmitDefaultValue = false)]
|
||||||
|
public string GroupId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Group
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "group", EmitDefaultValue = false)]
|
||||||
|
public Group Group { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ApplicationId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "application_id", EmitDefaultValue = false)]
|
||||||
|
public string ApplicationId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Application
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "application", EmitDefaultValue = false)]
|
||||||
|
public Application Application { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Stats
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "stats", EmitDefaultValue = true)]
|
||||||
|
public Object Stats { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Acquired
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "acquired", EmitDefaultValue = false)]
|
||||||
|
public DateTime Acquired { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastUsed
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_used", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastUsed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class GroupGame {\n");
|
||||||
|
sb.Append(" GroupId: ").Append(GroupId).Append("\n");
|
||||||
|
sb.Append(" Group: ").Append(Group).Append("\n");
|
||||||
|
sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n");
|
||||||
|
sb.Append(" Application: ").Append(Application).Append("\n");
|
||||||
|
sb.Append(" Stats: ").Append(Stats).Append("\n");
|
||||||
|
sb.Append(" Acquired: ").Append(Acquired).Append("\n");
|
||||||
|
sb.Append(" LastUsed: ").Append(LastUsed).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
155
src/Tribufu.Generated/Model/GroupMember.cs
Normal file
155
src/Tribufu.Generated/Model/GroupMember.cs
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// GroupMember
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "GroupMember")]
|
||||||
|
public partial class GroupMember : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Rank
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "rank", EmitDefaultValue = false)]
|
||||||
|
public GroupRank? Rank { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="GroupMember" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="uuid">uuid.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="displayName">displayName.</param>
|
||||||
|
/// <param name="verified">verified.</param>
|
||||||
|
/// <param name="photoUrl">photoUrl.</param>
|
||||||
|
/// <param name="lastOnline">lastOnline.</param>
|
||||||
|
/// <param name="rank">rank.</param>
|
||||||
|
/// <param name="since">since.</param>
|
||||||
|
public GroupMember(string id = default(string), Guid uuid = default(Guid), string name = default(string), string displayName = default(string), bool verified = default(bool), string photoUrl = default(string), DateTime? lastOnline = default(DateTime?), GroupRank? rank = default(GroupRank?), DateTime since = default(DateTime))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Uuid = uuid;
|
||||||
|
this.Name = name;
|
||||||
|
this.DisplayName = displayName;
|
||||||
|
this.Verified = verified;
|
||||||
|
this.PhotoUrl = photoUrl;
|
||||||
|
this.LastOnline = lastOnline;
|
||||||
|
this.Rank = rank;
|
||||||
|
this.Since = since;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uuid
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uuid", EmitDefaultValue = false)]
|
||||||
|
public Guid Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DisplayName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "display_name", EmitDefaultValue = true)]
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Verified
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "verified", EmitDefaultValue = true)]
|
||||||
|
public bool Verified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
|
||||||
|
public string PhotoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastOnline
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_online", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastOnline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Since
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "since", EmitDefaultValue = false)]
|
||||||
|
public DateTime Since { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class GroupMember {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
|
||||||
|
sb.Append(" Verified: ").Append(Verified).Append("\n");
|
||||||
|
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
|
||||||
|
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
|
||||||
|
sb.Append(" Rank: ").Append(Rank).Append("\n");
|
||||||
|
sb.Append(" Since: ").Append(Since).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
54
src/Tribufu.Generated/Model/GroupRank.cs
Normal file
54
src/Tribufu.Generated/Model/GroupRank.cs
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines GroupRank
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum GroupRank
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Member for value: member
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "member")]
|
||||||
|
Member,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Leader for value: leader
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "leader")]
|
||||||
|
Leader,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Owner for value: owner
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "owner")]
|
||||||
|
Owner
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
83
src/Tribufu.Generated/Model/HashViewModel.cs
Normal file
83
src/Tribufu.Generated/Model/HashViewModel.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// HashViewModel
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "HashViewModel")]
|
||||||
|
public partial class HashViewModel : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="HashViewModel" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">value.</param>
|
||||||
|
public HashViewModel(string value = default(string))
|
||||||
|
{
|
||||||
|
this.Value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Value
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "value", EmitDefaultValue = true)]
|
||||||
|
public string Value { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class HashViewModel {\n");
|
||||||
|
sb.Append(" Value: ").Append(Value).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
92
src/Tribufu.Generated/Model/IntrospectRequest.cs
Normal file
92
src/Tribufu.Generated/Model/IntrospectRequest.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// IntrospectRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "IntrospectRequest")]
|
||||||
|
public partial class IntrospectRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets TokenTypeHint
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "token_type_hint", EmitDefaultValue = false)]
|
||||||
|
public TokenHintType? TokenTypeHint { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="IntrospectRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="token">token.</param>
|
||||||
|
/// <param name="tokenTypeHint">tokenTypeHint.</param>
|
||||||
|
public IntrospectRequest(string token = default(string), TokenHintType? tokenTypeHint = default(TokenHintType?))
|
||||||
|
{
|
||||||
|
this.Token = token;
|
||||||
|
this.TokenTypeHint = tokenTypeHint;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Token
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "token", EmitDefaultValue = true)]
|
||||||
|
public string Token { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class IntrospectRequest {\n");
|
||||||
|
sb.Append(" Token: ").Append(Token).Append("\n");
|
||||||
|
sb.Append(" TokenTypeHint: ").Append(TokenTypeHint).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
320
src/Tribufu.Generated/Model/IpAddress.cs
Normal file
320
src/Tribufu.Generated/Model/IpAddress.cs
Normal file
@@ -0,0 +1,320 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// IpAddress
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "IpAddress")]
|
||||||
|
public partial class IpAddress : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="IpAddress" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="address">address.</param>
|
||||||
|
/// <param name="varVersion">varVersion.</param>
|
||||||
|
/// <param name="network">network.</param>
|
||||||
|
/// <param name="reserved">reserved.</param>
|
||||||
|
/// <param name="asn">asn.</param>
|
||||||
|
/// <param name="isp">isp.</param>
|
||||||
|
/// <param name="continent">continent.</param>
|
||||||
|
/// <param name="country">country.</param>
|
||||||
|
/// <param name="region">region.</param>
|
||||||
|
/// <param name="city">city.</param>
|
||||||
|
/// <param name="postalCode">postalCode.</param>
|
||||||
|
/// <param name="callingCode">callingCode.</param>
|
||||||
|
/// <param name="tld">tld.</param>
|
||||||
|
/// <param name="language">language.</param>
|
||||||
|
/// <param name="timezone">timezone.</param>
|
||||||
|
/// <param name="currency">currency.</param>
|
||||||
|
/// <param name="latitude">latitude.</param>
|
||||||
|
/// <param name="longitude">longitude.</param>
|
||||||
|
public IpAddress(string address = default(string), int varVersion = default(int), string network = default(string), bool reserved = default(bool), string asn = default(string), string isp = default(string), string continent = default(string), string country = default(string), string region = default(string), string city = default(string), string postalCode = default(string), string callingCode = default(string), string tld = default(string), string language = default(string), string timezone = default(string), string currency = default(string), float? latitude = default(float?), float? longitude = default(float?))
|
||||||
|
{
|
||||||
|
this.Address = address;
|
||||||
|
this.VarVersion = varVersion;
|
||||||
|
this.Network = network;
|
||||||
|
this.Reserved = reserved;
|
||||||
|
this.Asn = asn;
|
||||||
|
this.Isp = isp;
|
||||||
|
this.Continent = continent;
|
||||||
|
this.Country = country;
|
||||||
|
this.Region = region;
|
||||||
|
this.City = city;
|
||||||
|
this.PostalCode = postalCode;
|
||||||
|
this.CallingCode = callingCode;
|
||||||
|
this.Tld = tld;
|
||||||
|
this.Language = language;
|
||||||
|
this.Timezone = timezone;
|
||||||
|
this.Currency = currency;
|
||||||
|
this.Latitude = latitude;
|
||||||
|
this.Longitude = longitude;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Address
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "address", EmitDefaultValue = true)]
|
||||||
|
public string Address { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets VarVersion
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "version", EmitDefaultValue = false)]
|
||||||
|
public int VarVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Network
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "network", EmitDefaultValue = true)]
|
||||||
|
public string Network { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Reserved
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "reserved", EmitDefaultValue = true)]
|
||||||
|
public bool Reserved { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Asn
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "asn", EmitDefaultValue = true)]
|
||||||
|
public string Asn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Isp
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "isp", EmitDefaultValue = true)]
|
||||||
|
public string Isp { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Continent
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "continent", EmitDefaultValue = true)]
|
||||||
|
public string Continent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Country
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "country", EmitDefaultValue = true)]
|
||||||
|
public string Country { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Region
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "region", EmitDefaultValue = true)]
|
||||||
|
public string Region { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets City
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "city", EmitDefaultValue = true)]
|
||||||
|
public string City { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PostalCode
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "postal_code", EmitDefaultValue = true)]
|
||||||
|
public string PostalCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CallingCode
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "calling_code", EmitDefaultValue = true)]
|
||||||
|
public string CallingCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Tld
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "tld", EmitDefaultValue = true)]
|
||||||
|
public string Tld { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Language
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "language", EmitDefaultValue = true)]
|
||||||
|
public string Language { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Timezone
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "timezone", EmitDefaultValue = true)]
|
||||||
|
public string Timezone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Currency
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "currency", EmitDefaultValue = true)]
|
||||||
|
public string Currency { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Latitude
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "latitude", EmitDefaultValue = true)]
|
||||||
|
public float? Latitude { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Longitude
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "longitude", EmitDefaultValue = true)]
|
||||||
|
public float? Longitude { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class IpAddress {\n");
|
||||||
|
sb.Append(" Address: ").Append(Address).Append("\n");
|
||||||
|
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
|
||||||
|
sb.Append(" Network: ").Append(Network).Append("\n");
|
||||||
|
sb.Append(" Reserved: ").Append(Reserved).Append("\n");
|
||||||
|
sb.Append(" Asn: ").Append(Asn).Append("\n");
|
||||||
|
sb.Append(" Isp: ").Append(Isp).Append("\n");
|
||||||
|
sb.Append(" Continent: ").Append(Continent).Append("\n");
|
||||||
|
sb.Append(" Country: ").Append(Country).Append("\n");
|
||||||
|
sb.Append(" Region: ").Append(Region).Append("\n");
|
||||||
|
sb.Append(" City: ").Append(City).Append("\n");
|
||||||
|
sb.Append(" PostalCode: ").Append(PostalCode).Append("\n");
|
||||||
|
sb.Append(" CallingCode: ").Append(CallingCode).Append("\n");
|
||||||
|
sb.Append(" Tld: ").Append(Tld).Append("\n");
|
||||||
|
sb.Append(" Language: ").Append(Language).Append("\n");
|
||||||
|
sb.Append(" Timezone: ").Append(Timezone).Append("\n");
|
||||||
|
sb.Append(" Currency: ").Append(Currency).Append("\n");
|
||||||
|
sb.Append(" Latitude: ").Append(Latitude).Append("\n");
|
||||||
|
sb.Append(" Longitude: ").Append(Longitude).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Address (string) maxLength
|
||||||
|
if (this.Address != null && this.Address.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Address, length must be less than 255.", new [] { "Address" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Network (string) maxLength
|
||||||
|
if (this.Network != null && this.Network.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Network, length must be less than 255.", new [] { "Network" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Asn (string) maxLength
|
||||||
|
if (this.Asn != null && this.Asn.Length > 10)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Asn, length must be less than 10.", new [] { "Asn" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Isp (string) maxLength
|
||||||
|
if (this.Isp != null && this.Isp.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Isp, length must be less than 255.", new [] { "Isp" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Continent (string) maxLength
|
||||||
|
if (this.Continent != null && this.Continent.Length > 2)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Continent, length must be less than 2.", new [] { "Continent" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Country (string) maxLength
|
||||||
|
if (this.Country != null && this.Country.Length > 2)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Country, length must be less than 2.", new [] { "Country" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Region (string) maxLength
|
||||||
|
if (this.Region != null && this.Region.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Region, length must be less than 255.", new [] { "Region" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// City (string) maxLength
|
||||||
|
if (this.City != null && this.City.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for City, length must be less than 255.", new [] { "City" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostalCode (string) maxLength
|
||||||
|
if (this.PostalCode != null && this.PostalCode.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for PostalCode, length must be less than 45.", new [] { "PostalCode" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// CallingCode (string) maxLength
|
||||||
|
if (this.CallingCode != null && this.CallingCode.Length > 4)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for CallingCode, length must be less than 4.", new [] { "CallingCode" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tld (string) maxLength
|
||||||
|
if (this.Tld != null && this.Tld.Length > 3)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Tld, length must be less than 3.", new [] { "Tld" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Language (string) maxLength
|
||||||
|
if (this.Language != null && this.Language.Length > 5)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Language, length must be less than 5.", new [] { "Language" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Timezone (string) maxLength
|
||||||
|
if (this.Timezone != null && this.Timezone.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Timezone, length must be less than 45.", new [] { "Timezone" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Currency (string) maxLength
|
||||||
|
if (this.Currency != null && this.Currency.Length > 3)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Currency, length must be less than 3.", new [] { "Currency" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
128
src/Tribufu.Generated/Model/LeaderboardItem.cs
Normal file
128
src/Tribufu.Generated/Model/LeaderboardItem.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// LeaderboardItem
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "LeaderboardItem")]
|
||||||
|
public partial class LeaderboardItem : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LeaderboardItem" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="displayName">displayName.</param>
|
||||||
|
/// <param name="photoUrl">photoUrl.</param>
|
||||||
|
/// <param name="level">level.</param>
|
||||||
|
/// <param name="experience">experience.</param>
|
||||||
|
/// <param name="points">points.</param>
|
||||||
|
public LeaderboardItem(string name = default(string), string displayName = default(string), string photoUrl = default(string), int level = default(int), double experience = default(double), double points = default(double))
|
||||||
|
{
|
||||||
|
this.Name = name;
|
||||||
|
this.DisplayName = displayName;
|
||||||
|
this.PhotoUrl = photoUrl;
|
||||||
|
this.Level = level;
|
||||||
|
this.Experience = experience;
|
||||||
|
this.Points = points;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DisplayName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "display_name", EmitDefaultValue = true)]
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
|
||||||
|
public string PhotoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Level
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "level", EmitDefaultValue = false)]
|
||||||
|
public int Level { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Experience
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "experience", EmitDefaultValue = false)]
|
||||||
|
public double Experience { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Points
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "points", EmitDefaultValue = false)]
|
||||||
|
public double Points { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class LeaderboardItem {\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
|
||||||
|
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
|
||||||
|
sb.Append(" Level: ").Append(Level).Append("\n");
|
||||||
|
sb.Append(" Experience: ").Append(Experience).Append("\n");
|
||||||
|
sb.Append(" Points: ").Append(Points).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/Tribufu.Generated/Model/LeaderboardOrder.cs
Normal file
48
src/Tribufu.Generated/Model/LeaderboardOrder.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines LeaderboardOrder
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum LeaderboardOrder
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Level for value: level
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "level")]
|
||||||
|
Level,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Points for value: points
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "points")]
|
||||||
|
Points
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
78
src/Tribufu.Generated/Model/LoginProvider.cs
Normal file
78
src/Tribufu.Generated/Model/LoginProvider.cs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines LoginProvider
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum LoginProvider
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Steam for value: steam
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "steam")]
|
||||||
|
Steam,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Epic for value: epic
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "epic")]
|
||||||
|
Epic,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Discord for value: discord
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "discord")]
|
||||||
|
Discord,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Microsoft for value: microsoft
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "microsoft")]
|
||||||
|
Microsoft,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Playstation for value: playstation
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "playstation")]
|
||||||
|
Playstation,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Google for value: google
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "google")]
|
||||||
|
Google,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Apple for value: apple
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "apple")]
|
||||||
|
Apple
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
92
src/Tribufu.Generated/Model/LoginRequest.cs
Normal file
92
src/Tribufu.Generated/Model/LoginRequest.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// LoginRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "LoginRequest")]
|
||||||
|
public partial class LoginRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LoginRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="login">login.</param>
|
||||||
|
/// <param name="password">password.</param>
|
||||||
|
public LoginRequest(string login = default(string), string password = default(string))
|
||||||
|
{
|
||||||
|
this.Login = login;
|
||||||
|
this.Password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Login
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "login", EmitDefaultValue = true)]
|
||||||
|
public string Login { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Password
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "password", EmitDefaultValue = true)]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class LoginRequest {\n");
|
||||||
|
sb.Append(" Login: ").Append(Login).Append("\n");
|
||||||
|
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
110
src/Tribufu.Generated/Model/LoginResponse.cs
Normal file
110
src/Tribufu.Generated/Model/LoginResponse.cs
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// LoginResponse
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "LoginResponse")]
|
||||||
|
public partial class LoginResponse : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="LoginResponse" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">user.</param>
|
||||||
|
/// <param name="accessToken">accessToken.</param>
|
||||||
|
/// <param name="refreshToken">refreshToken.</param>
|
||||||
|
/// <param name="expiresIn">expiresIn.</param>
|
||||||
|
public LoginResponse(UserInfo user = default(UserInfo), string accessToken = default(string), string refreshToken = default(string), long expiresIn = default(long))
|
||||||
|
{
|
||||||
|
this.User = user;
|
||||||
|
this.AccessToken = accessToken;
|
||||||
|
this.RefreshToken = refreshToken;
|
||||||
|
this.ExpiresIn = expiresIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets User
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "user", EmitDefaultValue = false)]
|
||||||
|
public UserInfo User { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets AccessToken
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "access_token", EmitDefaultValue = true)]
|
||||||
|
public string AccessToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RefreshToken
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
|
||||||
|
public string RefreshToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ExpiresIn
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "expires_in", EmitDefaultValue = false)]
|
||||||
|
public long ExpiresIn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class LoginResponse {\n");
|
||||||
|
sb.Append(" User: ").Append(User).Append("\n");
|
||||||
|
sb.Append(" AccessToken: ").Append(AccessToken).Append("\n");
|
||||||
|
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
|
||||||
|
sb.Append(" ExpiresIn: ").Append(ExpiresIn).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
188
src/Tribufu.Generated/Model/Package.cs
Normal file
188
src/Tribufu.Generated/Model/Package.cs
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Package
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Package")]
|
||||||
|
public partial class Package : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Package" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="imageUrl">imageUrl.</param>
|
||||||
|
/// <param name="authorId">authorId.</param>
|
||||||
|
/// <param name="varVersion">varVersion.</param>
|
||||||
|
/// <param name="fileUrl">fileUrl.</param>
|
||||||
|
/// <param name="rawSize">rawSize.</param>
|
||||||
|
/// <param name="downloadCount">downloadCount.</param>
|
||||||
|
/// <param name="lastDownload">lastDownload.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Package(string id = default(string), string name = default(string), string description = default(string), string imageUrl = default(string), string authorId = default(string), string varVersion = default(string), string fileUrl = default(string), double rawSize = default(double), int downloadCount = default(int), DateTime? lastDownload = default(DateTime?), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Description = description;
|
||||||
|
this.ImageUrl = imageUrl;
|
||||||
|
this.AuthorId = authorId;
|
||||||
|
this.VarVersion = varVersion;
|
||||||
|
this.FileUrl = fileUrl;
|
||||||
|
this.RawSize = rawSize;
|
||||||
|
this.DownloadCount = downloadCount;
|
||||||
|
this.LastDownload = lastDownload;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "image_url", EmitDefaultValue = true)]
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets AuthorId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "author_id", EmitDefaultValue = false)]
|
||||||
|
public string AuthorId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets VarVersion
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "version", EmitDefaultValue = true)]
|
||||||
|
public string VarVersion { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets FileUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "file_url", EmitDefaultValue = true)]
|
||||||
|
public string FileUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RawSize
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "raw_size", EmitDefaultValue = false)]
|
||||||
|
public double RawSize { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DownloadCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "download_count", EmitDefaultValue = false)]
|
||||||
|
public int DownloadCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastDownload
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_download", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastDownload { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Package {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" ImageUrl: ").Append(ImageUrl).Append("\n");
|
||||||
|
sb.Append(" AuthorId: ").Append(AuthorId).Append("\n");
|
||||||
|
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
|
||||||
|
sb.Append(" FileUrl: ").Append(FileUrl).Append("\n");
|
||||||
|
sb.Append(" RawSize: ").Append(RawSize).Append("\n");
|
||||||
|
sb.Append(" DownloadCount: ").Append(DownloadCount).Append("\n");
|
||||||
|
sb.Append(" LastDownload: ").Append(LastDownload).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 45.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
236
src/Tribufu.Generated/Model/Profile.cs
Normal file
236
src/Tribufu.Generated/Model/Profile.cs
Normal file
@@ -0,0 +1,236 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Profile
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Profile")]
|
||||||
|
public partial class Profile : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Profile" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="uuid">uuid.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="displayName">displayName.</param>
|
||||||
|
/// <param name="verified">verified.</param>
|
||||||
|
/// <param name="level">level.</param>
|
||||||
|
/// <param name="experience">experience.</param>
|
||||||
|
/// <param name="publicBirthday">publicBirthday.</param>
|
||||||
|
/// <param name="birthday">birthday.</param>
|
||||||
|
/// <param name="points">points.</param>
|
||||||
|
/// <param name="location">location.</param>
|
||||||
|
/// <param name="photoUrl">photoUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="lastOnline">lastOnline.</param>
|
||||||
|
/// <param name="biography">biography.</param>
|
||||||
|
/// <param name="viewCount">viewCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Profile(string id = default(string), Guid uuid = default(Guid), string name = default(string), string displayName = default(string), bool verified = default(bool), int level = default(int), double experience = default(double), bool publicBirthday = default(bool), DateOnly? birthday = default(DateOnly?), double points = default(double), string location = default(string), string photoUrl = default(string), string bannerUrl = default(string), DateTime? lastOnline = default(DateTime?), string biography = default(string), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Uuid = uuid;
|
||||||
|
this.Name = name;
|
||||||
|
this.DisplayName = displayName;
|
||||||
|
this.Verified = verified;
|
||||||
|
this.Level = level;
|
||||||
|
this.Experience = experience;
|
||||||
|
this.PublicBirthday = publicBirthday;
|
||||||
|
this.Birthday = birthday;
|
||||||
|
this.Points = points;
|
||||||
|
this.Location = location;
|
||||||
|
this.PhotoUrl = photoUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.LastOnline = lastOnline;
|
||||||
|
this.Biography = biography;
|
||||||
|
this.ViewCount = viewCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uuid
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uuid", EmitDefaultValue = false)]
|
||||||
|
public Guid Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DisplayName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "display_name", EmitDefaultValue = true)]
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Verified
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "verified", EmitDefaultValue = true)]
|
||||||
|
public bool Verified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Level
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "level", EmitDefaultValue = false)]
|
||||||
|
public int Level { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Experience
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "experience", EmitDefaultValue = false)]
|
||||||
|
public double Experience { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PublicBirthday
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "public_birthday", EmitDefaultValue = true)]
|
||||||
|
public bool PublicBirthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Birthday
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "birthday", EmitDefaultValue = true)]
|
||||||
|
public DateOnly? Birthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Points
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "points", EmitDefaultValue = false)]
|
||||||
|
public double Points { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Location
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "location", EmitDefaultValue = true)]
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
|
||||||
|
public string PhotoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastOnline
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_online", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastOnline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Biography
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "biography", EmitDefaultValue = true)]
|
||||||
|
public string Biography { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ViewCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "view_count", EmitDefaultValue = false)]
|
||||||
|
public int ViewCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Profile {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
|
||||||
|
sb.Append(" Verified: ").Append(Verified).Append("\n");
|
||||||
|
sb.Append(" Level: ").Append(Level).Append("\n");
|
||||||
|
sb.Append(" Experience: ").Append(Experience).Append("\n");
|
||||||
|
sb.Append(" PublicBirthday: ").Append(PublicBirthday).Append("\n");
|
||||||
|
sb.Append(" Birthday: ").Append(Birthday).Append("\n");
|
||||||
|
sb.Append(" Points: ").Append(Points).Append("\n");
|
||||||
|
sb.Append(" Location: ").Append(Location).Append("\n");
|
||||||
|
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
|
||||||
|
sb.Append(" Biography: ").Append(Biography).Append("\n");
|
||||||
|
sb.Append(" ViewCount: ").Append(ViewCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
173
src/Tribufu.Generated/Model/ProfileGame.cs
Normal file
173
src/Tribufu.Generated/Model/ProfileGame.cs
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ProfileGame
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "ProfileGame")]
|
||||||
|
public partial class ProfileGame : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ProfileGame" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="capsuleImageUrl">capsuleImageUrl.</param>
|
||||||
|
/// <param name="libraryImageUrl">libraryImageUrl.</param>
|
||||||
|
/// <param name="slug">slug.</param>
|
||||||
|
/// <param name="timeUsed">timeUsed.</param>
|
||||||
|
/// <param name="unlockedAchievements">unlockedAchievements.</param>
|
||||||
|
/// <param name="totalAchievements">totalAchievements.</param>
|
||||||
|
/// <param name="stats">stats.</param>
|
||||||
|
/// <param name="acquired">acquired.</param>
|
||||||
|
/// <param name="lastUsed">lastUsed.</param>
|
||||||
|
public ProfileGame(string id = default(string), string name = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string slug = default(string), double timeUsed = default(double), int unlockedAchievements = default(int), int totalAchievements = default(int), Object stats = default(Object), DateTime acquired = default(DateTime), DateTime? lastUsed = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.CapsuleImageUrl = capsuleImageUrl;
|
||||||
|
this.LibraryImageUrl = libraryImageUrl;
|
||||||
|
this.Slug = slug;
|
||||||
|
this.TimeUsed = timeUsed;
|
||||||
|
this.UnlockedAchievements = unlockedAchievements;
|
||||||
|
this.TotalAchievements = totalAchievements;
|
||||||
|
this.Stats = stats;
|
||||||
|
this.Acquired = acquired;
|
||||||
|
this.LastUsed = lastUsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CapsuleImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "capsule_image_url", EmitDefaultValue = true)]
|
||||||
|
public string CapsuleImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LibraryImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "library_image_url", EmitDefaultValue = true)]
|
||||||
|
public string LibraryImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Slug
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "slug", EmitDefaultValue = true)]
|
||||||
|
public string Slug { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets TimeUsed
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "time_used", EmitDefaultValue = false)]
|
||||||
|
public double TimeUsed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets UnlockedAchievements
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "unlocked_achievements", EmitDefaultValue = false)]
|
||||||
|
public int UnlockedAchievements { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets TotalAchievements
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "total_achievements", EmitDefaultValue = false)]
|
||||||
|
public int TotalAchievements { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Stats
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "stats", EmitDefaultValue = true)]
|
||||||
|
public Object Stats { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Acquired
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "acquired", EmitDefaultValue = false)]
|
||||||
|
public DateTime Acquired { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastUsed
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_used", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastUsed { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class ProfileGame {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
|
||||||
|
sb.Append(" LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
|
||||||
|
sb.Append(" Slug: ").Append(Slug).Append("\n");
|
||||||
|
sb.Append(" TimeUsed: ").Append(TimeUsed).Append("\n");
|
||||||
|
sb.Append(" UnlockedAchievements: ").Append(UnlockedAchievements).Append("\n");
|
||||||
|
sb.Append(" TotalAchievements: ").Append(TotalAchievements).Append("\n");
|
||||||
|
sb.Append(" Stats: ").Append(Stats).Append("\n");
|
||||||
|
sb.Append(" Acquired: ").Append(Acquired).Append("\n");
|
||||||
|
sb.Append(" LastUsed: ").Append(LastUsed).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
164
src/Tribufu.Generated/Model/ProfileGroup.cs
Normal file
164
src/Tribufu.Generated/Model/ProfileGroup.cs
Normal file
@@ -0,0 +1,164 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ProfileGroup
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "ProfileGroup")]
|
||||||
|
public partial class ProfileGroup : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Rank
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "rank", EmitDefaultValue = false)]
|
||||||
|
public GroupRank? Rank { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ProfileGroup" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="uuid">uuid.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="tag">tag.</param>
|
||||||
|
/// <param name="privacy">privacy.</param>
|
||||||
|
/// <param name="verified">verified.</param>
|
||||||
|
/// <param name="photoUrl">photoUrl.</param>
|
||||||
|
/// <param name="memberCount">memberCount.</param>
|
||||||
|
/// <param name="rank">rank.</param>
|
||||||
|
/// <param name="since">since.</param>
|
||||||
|
public ProfileGroup(string id = default(string), Guid uuid = default(Guid), string name = default(string), string tag = default(string), int privacy = default(int), bool verified = default(bool), string photoUrl = default(string), int memberCount = default(int), GroupRank? rank = default(GroupRank?), DateTime since = default(DateTime))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Uuid = uuid;
|
||||||
|
this.Name = name;
|
||||||
|
this.Tag = tag;
|
||||||
|
this.Privacy = privacy;
|
||||||
|
this.Verified = verified;
|
||||||
|
this.PhotoUrl = photoUrl;
|
||||||
|
this.MemberCount = memberCount;
|
||||||
|
this.Rank = rank;
|
||||||
|
this.Since = since;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uuid
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uuid", EmitDefaultValue = false)]
|
||||||
|
public Guid Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Tag
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "tag", EmitDefaultValue = true)]
|
||||||
|
public string Tag { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Privacy
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "privacy", EmitDefaultValue = false)]
|
||||||
|
public int Privacy { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Verified
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "verified", EmitDefaultValue = true)]
|
||||||
|
public bool Verified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
|
||||||
|
public string PhotoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets MemberCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "member_count", EmitDefaultValue = false)]
|
||||||
|
public int MemberCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Since
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "since", EmitDefaultValue = false)]
|
||||||
|
public DateTime Since { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class ProfileGroup {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Tag: ").Append(Tag).Append("\n");
|
||||||
|
sb.Append(" Privacy: ").Append(Privacy).Append("\n");
|
||||||
|
sb.Append(" Verified: ").Append(Verified).Append("\n");
|
||||||
|
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
|
||||||
|
sb.Append(" MemberCount: ").Append(MemberCount).Append("\n");
|
||||||
|
sb.Append(" Rank: ").Append(Rank).Append("\n");
|
||||||
|
sb.Append(" Since: ").Append(Since).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
83
src/Tribufu.Generated/Model/RefreshRequest.cs
Normal file
83
src/Tribufu.Generated/Model/RefreshRequest.cs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RefreshRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "RefreshRequest")]
|
||||||
|
public partial class RefreshRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RefreshRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="refreshToken">refreshToken.</param>
|
||||||
|
public RefreshRequest(string refreshToken = default(string))
|
||||||
|
{
|
||||||
|
this.RefreshToken = refreshToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RefreshToken
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
|
||||||
|
public string RefreshToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class RefreshRequest {\n");
|
||||||
|
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
167
src/Tribufu.Generated/Model/RegisterRequest.cs
Normal file
167
src/Tribufu.Generated/Model/RegisterRequest.cs
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RegisterRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "RegisterRequest")]
|
||||||
|
public partial class RegisterRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RegisterRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
[JsonConstructorAttribute]
|
||||||
|
protected RegisterRequest() { }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RegisterRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="uuid">uuid.</param>
|
||||||
|
/// <param name="name">name (required).</param>
|
||||||
|
/// <param name="email">email.</param>
|
||||||
|
/// <param name="password">password (required).</param>
|
||||||
|
public RegisterRequest(Guid? uuid = default(Guid?), string name = default(string), string email = default(string), string password = default(string))
|
||||||
|
{
|
||||||
|
// to ensure "name" is required (not null)
|
||||||
|
if (name == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("name is a required property for RegisterRequest and cannot be null");
|
||||||
|
}
|
||||||
|
this.Name = name;
|
||||||
|
// to ensure "password" is required (not null)
|
||||||
|
if (password == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("password is a required property for RegisterRequest and cannot be null");
|
||||||
|
}
|
||||||
|
this.Password = password;
|
||||||
|
this.Uuid = uuid;
|
||||||
|
this.Email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uuid
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uuid", EmitDefaultValue = true)]
|
||||||
|
public Guid? Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Email
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "email", EmitDefaultValue = true)]
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Password
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "password", IsRequired = true, EmitDefaultValue = true)]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class RegisterRequest {\n");
|
||||||
|
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||||
|
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 45)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 45.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name (string) minLength
|
||||||
|
if (this.Name != null && this.Name.Length < 3)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be greater than 3.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.Name != null) {
|
||||||
|
// Name (string) pattern
|
||||||
|
Regex regexName = new Regex(@"^[a-zA-Z0-9-_]*$", RegexOptions.CultureInvariant);
|
||||||
|
if (!regexName.Match(this.Name).Success)
|
||||||
|
{
|
||||||
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Email (string) maxLength
|
||||||
|
if (this.Email != null && this.Email.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Email, length must be less than 255.", new [] { "Email" });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.Email != null) {
|
||||||
|
// Email (string) pattern
|
||||||
|
Regex regexEmail = new Regex(@"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$", RegexOptions.CultureInvariant);
|
||||||
|
if (!regexEmail.Match(this.Email).Success)
|
||||||
|
{
|
||||||
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Email, must match a pattern of " + regexEmail, new [] { "Email" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Password (string) minLength
|
||||||
|
if (this.Password != null && this.Password.Length < 1)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Password, length must be greater than 1.", new [] { "Password" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/Tribufu.Generated/Model/ResponseType.cs
Normal file
48
src/Tribufu.Generated/Model/ResponseType.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines ResponseType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum ResponseType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Code for value: code
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "code")]
|
||||||
|
Code,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Token for value: token
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "token")]
|
||||||
|
Token
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
92
src/Tribufu.Generated/Model/RevokeRequest.cs
Normal file
92
src/Tribufu.Generated/Model/RevokeRequest.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// RevokeRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "RevokeRequest")]
|
||||||
|
public partial class RevokeRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets TokenTypeHint
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "token_type_hint", EmitDefaultValue = false)]
|
||||||
|
public TokenHintType? TokenTypeHint { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="RevokeRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="token">token.</param>
|
||||||
|
/// <param name="tokenTypeHint">tokenTypeHint.</param>
|
||||||
|
public RevokeRequest(string token = default(string), TokenHintType? tokenTypeHint = default(TokenHintType?))
|
||||||
|
{
|
||||||
|
this.Token = token;
|
||||||
|
this.TokenTypeHint = tokenTypeHint;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Token
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "token", EmitDefaultValue = true)]
|
||||||
|
public string Token { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class RevokeRequest {\n");
|
||||||
|
sb.Append(" Token: ").Append(Token).Append("\n");
|
||||||
|
sb.Append(" TokenTypeHint: ").Append(TokenTypeHint).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
110
src/Tribufu.Generated/Model/SearchRequest.cs
Normal file
110
src/Tribufu.Generated/Model/SearchRequest.cs
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// SearchRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "SearchRequest")]
|
||||||
|
public partial class SearchRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Type
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||||
|
public SearchType? Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="SearchRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type">type.</param>
|
||||||
|
/// <param name="query">query.</param>
|
||||||
|
/// <param name="page">page.</param>
|
||||||
|
/// <param name="gameId">gameId.</param>
|
||||||
|
public SearchRequest(SearchType? type = default(SearchType?), string query = default(string), int? page = default(int?), string gameId = default(string))
|
||||||
|
{
|
||||||
|
this.Type = type;
|
||||||
|
this.Query = query;
|
||||||
|
this.Page = page;
|
||||||
|
this.GameId = gameId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Query
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "query", EmitDefaultValue = true)]
|
||||||
|
public string Query { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Page
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "page", EmitDefaultValue = true)]
|
||||||
|
public int? Page { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GameId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "game_id", EmitDefaultValue = true)]
|
||||||
|
public string GameId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class SearchRequest {\n");
|
||||||
|
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||||
|
sb.Append(" Query: ").Append(Query).Append("\n");
|
||||||
|
sb.Append(" Page: ").Append(Page).Append("\n");
|
||||||
|
sb.Append(" GameId: ").Append(GameId).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
60
src/Tribufu.Generated/Model/SearchType.cs
Normal file
60
src/Tribufu.Generated/Model/SearchType.cs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines SearchType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum SearchType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum User for value: user
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "user")]
|
||||||
|
User,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Group for value: group
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "group")]
|
||||||
|
Group,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Server for value: server
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "server")]
|
||||||
|
Server,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Cluster for value: cluster
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "cluster")]
|
||||||
|
Cluster
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
101
src/Tribufu.Generated/Model/ServerMetrics.cs
Normal file
101
src/Tribufu.Generated/Model/ServerMetrics.cs
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// ServerMetrics
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "ServerMetrics")]
|
||||||
|
public partial class ServerMetrics : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="ServerMetrics" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="serverCount">serverCount.</param>
|
||||||
|
/// <param name="packageCount">packageCount.</param>
|
||||||
|
/// <param name="countryCount">countryCount.</param>
|
||||||
|
public ServerMetrics(int serverCount = default(int), int packageCount = default(int), int countryCount = default(int))
|
||||||
|
{
|
||||||
|
this.ServerCount = serverCount;
|
||||||
|
this.PackageCount = packageCount;
|
||||||
|
this.CountryCount = countryCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ServerCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "server_count", EmitDefaultValue = false)]
|
||||||
|
public int ServerCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PackageCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "package_count", EmitDefaultValue = false)]
|
||||||
|
public int PackageCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CountryCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "country_count", EmitDefaultValue = false)]
|
||||||
|
public int CountryCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class ServerMetrics {\n");
|
||||||
|
sb.Append(" ServerCount: ").Append(ServerCount).Append("\n");
|
||||||
|
sb.Append(" PackageCount: ").Append(PackageCount).Append("\n");
|
||||||
|
sb.Append(" CountryCount: ").Append(CountryCount).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
54
src/Tribufu.Generated/Model/ServerStatus.cs
Normal file
54
src/Tribufu.Generated/Model/ServerStatus.cs
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines ServerStatus
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum ServerStatus
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Unknown for value: unknown
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "unknown")]
|
||||||
|
Unknown,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Offline for value: offline
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "offline")]
|
||||||
|
Offline,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Online for value: online
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "online")]
|
||||||
|
Online
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
155
src/Tribufu.Generated/Model/Subscription.cs
Normal file
155
src/Tribufu.Generated/Model/Subscription.cs
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Subscription
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "Subscription")]
|
||||||
|
public partial class Subscription : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="Subscription" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="description">description.</param>
|
||||||
|
/// <param name="imageUrl">imageUrl.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public Subscription(string id = default(string), string name = default(string), string description = default(string), string imageUrl = default(string), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Name = name;
|
||||||
|
this.Description = description;
|
||||||
|
this.ImageUrl = imageUrl;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Description
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ImageUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "image_url", EmitDefaultValue = true)]
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Prices
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "prices", EmitDefaultValue = true)]
|
||||||
|
public Dictionary<string, double> Prices { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns false as Prices should not be serialized given that it's read-only.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>false (boolean)</returns>
|
||||||
|
public bool ShouldSerializePrices()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class Subscription {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||||
|
sb.Append(" ImageUrl: ").Append(ImageUrl).Append("\n");
|
||||||
|
sb.Append(" Prices: ").Append(Prices).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
// Name (string) maxLength
|
||||||
|
if (this.Name != null && this.Name.Length > 75)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
|
||||||
|
}
|
||||||
|
|
||||||
|
// ImageUrl (string) maxLength
|
||||||
|
if (this.ImageUrl != null && this.ImageUrl.Length > 255)
|
||||||
|
{
|
||||||
|
yield return new ValidationResult("Invalid value for ImageUrl, length must be less than 255.", new [] { "ImageUrl" });
|
||||||
|
}
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/Tribufu.Generated/Model/TokenHintType.cs
Normal file
48
src/Tribufu.Generated/Model/TokenHintType.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines TokenHintType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum TokenHintType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum AccessToken for value: access_token
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "access_token")]
|
||||||
|
AccessToken,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum RefreshToken for value: refresh_token
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "refresh_token")]
|
||||||
|
RefreshToken
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
146
src/Tribufu.Generated/Model/TokenRequest.cs
Normal file
146
src/Tribufu.Generated/Model/TokenRequest.cs
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TokenRequest
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "TokenRequest")]
|
||||||
|
public partial class TokenRequest : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets GrantType
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "grant_type", EmitDefaultValue = false)]
|
||||||
|
public GrantType? GrantType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="TokenRequest" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="grantType">grantType.</param>
|
||||||
|
/// <param name="code">code.</param>
|
||||||
|
/// <param name="username">username.</param>
|
||||||
|
/// <param name="password">password.</param>
|
||||||
|
/// <param name="refreshToken">refreshToken.</param>
|
||||||
|
/// <param name="clientId">clientId.</param>
|
||||||
|
/// <param name="redirectUri">redirectUri.</param>
|
||||||
|
/// <param name="codeVerifier">codeVerifier.</param>
|
||||||
|
public TokenRequest(GrantType? grantType = default(GrantType?), string code = default(string), string username = default(string), string password = default(string), string refreshToken = default(string), string clientId = default(string), string redirectUri = default(string), string codeVerifier = default(string))
|
||||||
|
{
|
||||||
|
this.GrantType = grantType;
|
||||||
|
this.Code = code;
|
||||||
|
this.Username = username;
|
||||||
|
this.Password = password;
|
||||||
|
this.RefreshToken = refreshToken;
|
||||||
|
this.ClientId = clientId;
|
||||||
|
this.RedirectUri = redirectUri;
|
||||||
|
this.CodeVerifier = codeVerifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Code
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "code", EmitDefaultValue = true)]
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Username
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "username", EmitDefaultValue = true)]
|
||||||
|
public string Username { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Password
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "password", EmitDefaultValue = true)]
|
||||||
|
public string Password { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RefreshToken
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
|
||||||
|
public string RefreshToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ClientId
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "client_id", EmitDefaultValue = true)]
|
||||||
|
public string ClientId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RedirectUri
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "redirect_uri", EmitDefaultValue = true)]
|
||||||
|
public string RedirectUri { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets CodeVerifier
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "code_verifier", EmitDefaultValue = true)]
|
||||||
|
public string CodeVerifier { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class TokenRequest {\n");
|
||||||
|
sb.Append(" GrantType: ").Append(GrantType).Append("\n");
|
||||||
|
sb.Append(" Code: ").Append(Code).Append("\n");
|
||||||
|
sb.Append(" Username: ").Append(Username).Append("\n");
|
||||||
|
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||||
|
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
|
||||||
|
sb.Append(" ClientId: ").Append(ClientId).Append("\n");
|
||||||
|
sb.Append(" RedirectUri: ").Append(RedirectUri).Append("\n");
|
||||||
|
sb.Append(" CodeVerifier: ").Append(CodeVerifier).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
128
src/Tribufu.Generated/Model/TokenResponse.cs
Normal file
128
src/Tribufu.Generated/Model/TokenResponse.cs
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// TokenResponse
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "TokenResponse")]
|
||||||
|
public partial class TokenResponse : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets TokenType
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "token_type", EmitDefaultValue = false)]
|
||||||
|
public TokenType? TokenType { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="TokenResponse" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tokenType">tokenType.</param>
|
||||||
|
/// <param name="accessToken">accessToken.</param>
|
||||||
|
/// <param name="refreshToken">refreshToken.</param>
|
||||||
|
/// <param name="scope">scope.</param>
|
||||||
|
/// <param name="state">state.</param>
|
||||||
|
/// <param name="expiresIn">expiresIn.</param>
|
||||||
|
public TokenResponse(TokenType? tokenType = default(TokenType?), string accessToken = default(string), string refreshToken = default(string), string scope = default(string), string state = default(string), long expiresIn = default(long))
|
||||||
|
{
|
||||||
|
this.TokenType = tokenType;
|
||||||
|
this.AccessToken = accessToken;
|
||||||
|
this.RefreshToken = refreshToken;
|
||||||
|
this.Scope = scope;
|
||||||
|
this.State = state;
|
||||||
|
this.ExpiresIn = expiresIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets AccessToken
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "access_token", EmitDefaultValue = true)]
|
||||||
|
public string AccessToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets RefreshToken
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
|
||||||
|
public string RefreshToken { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Scope
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "scope", EmitDefaultValue = true)]
|
||||||
|
public string Scope { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets State
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "state", EmitDefaultValue = true)]
|
||||||
|
public string State { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ExpiresIn
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "expires_in", EmitDefaultValue = false)]
|
||||||
|
public long ExpiresIn { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class TokenResponse {\n");
|
||||||
|
sb.Append(" TokenType: ").Append(TokenType).Append("\n");
|
||||||
|
sb.Append(" AccessToken: ").Append(AccessToken).Append("\n");
|
||||||
|
sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n");
|
||||||
|
sb.Append(" Scope: ").Append(Scope).Append("\n");
|
||||||
|
sb.Append(" State: ").Append(State).Append("\n");
|
||||||
|
sb.Append(" ExpiresIn: ").Append(ExpiresIn).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
42
src/Tribufu.Generated/Model/TokenType.cs
Normal file
42
src/Tribufu.Generated/Model/TokenType.cs
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines TokenType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum TokenType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Bearer for value: bearer
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "bearer")]
|
||||||
|
Bearer
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
92
src/Tribufu.Generated/Model/UpdateProfile.cs
Normal file
92
src/Tribufu.Generated/Model/UpdateProfile.cs
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// UpdateProfile
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "UpdateProfile")]
|
||||||
|
public partial class UpdateProfile : IValidatableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UpdateProfile" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="displayName">displayName.</param>
|
||||||
|
/// <param name="biography">biography.</param>
|
||||||
|
public UpdateProfile(string displayName = default(string), string biography = default(string))
|
||||||
|
{
|
||||||
|
this.DisplayName = displayName;
|
||||||
|
this.Biography = biography;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DisplayName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "display_name", EmitDefaultValue = true)]
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Biography
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "biography", EmitDefaultValue = true)]
|
||||||
|
public string Biography { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class UpdateProfile {\n");
|
||||||
|
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
|
||||||
|
sb.Append(" Biography: ").Append(Biography).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
299
src/Tribufu.Generated/Model/UserInfo.cs
Normal file
299
src/Tribufu.Generated/Model/UserInfo.cs
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// UserInfo
|
||||||
|
/// </summary>
|
||||||
|
[DataContract(Name = "UserInfo")]
|
||||||
|
public partial class UserInfo : IValidatableObject
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Type
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "type", EmitDefaultValue = false)]
|
||||||
|
public UserType? Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes a new instance of the <see cref="UserInfo" /> class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id">id.</param>
|
||||||
|
/// <param name="uuid">uuid.</param>
|
||||||
|
/// <param name="name">name.</param>
|
||||||
|
/// <param name="displayName">displayName.</param>
|
||||||
|
/// <param name="email">email.</param>
|
||||||
|
/// <param name="type">type.</param>
|
||||||
|
/// <param name="flags">flags.</param>
|
||||||
|
/// <param name="permissions">permissions.</param>
|
||||||
|
/// <param name="verified">verified.</param>
|
||||||
|
/// <param name="level">level.</param>
|
||||||
|
/// <param name="experience">experience.</param>
|
||||||
|
/// <param name="publicBirthday">publicBirthday.</param>
|
||||||
|
/// <param name="birthday">birthday.</param>
|
||||||
|
/// <param name="points">points.</param>
|
||||||
|
/// <param name="location">location.</param>
|
||||||
|
/// <param name="language">language.</param>
|
||||||
|
/// <param name="timezone">timezone.</param>
|
||||||
|
/// <param name="currency">currency.</param>
|
||||||
|
/// <param name="photoUrl">photoUrl.</param>
|
||||||
|
/// <param name="bannerUrl">bannerUrl.</param>
|
||||||
|
/// <param name="lastOnline">lastOnline.</param>
|
||||||
|
/// <param name="biography">biography.</param>
|
||||||
|
/// <param name="viewCount">viewCount.</param>
|
||||||
|
/// <param name="created">created.</param>
|
||||||
|
/// <param name="updated">updated.</param>
|
||||||
|
public UserInfo(string id = default(string), Guid uuid = default(Guid), string name = default(string), string displayName = default(string), string email = default(string), UserType? type = default(UserType?), string flags = default(string), string permissions = default(string), bool verified = default(bool), int level = default(int), double experience = default(double), bool publicBirthday = default(bool), DateOnly? birthday = default(DateOnly?), double points = default(double), string location = default(string), string language = default(string), string timezone = default(string), string currency = default(string), string photoUrl = default(string), string bannerUrl = default(string), DateTime? lastOnline = default(DateTime?), string biography = default(string), int viewCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
|
||||||
|
{
|
||||||
|
this.Id = id;
|
||||||
|
this.Uuid = uuid;
|
||||||
|
this.Name = name;
|
||||||
|
this.DisplayName = displayName;
|
||||||
|
this.Email = email;
|
||||||
|
this.Type = type;
|
||||||
|
this.Flags = flags;
|
||||||
|
this.Permissions = permissions;
|
||||||
|
this.Verified = verified;
|
||||||
|
this.Level = level;
|
||||||
|
this.Experience = experience;
|
||||||
|
this.PublicBirthday = publicBirthday;
|
||||||
|
this.Birthday = birthday;
|
||||||
|
this.Points = points;
|
||||||
|
this.Location = location;
|
||||||
|
this.Language = language;
|
||||||
|
this.Timezone = timezone;
|
||||||
|
this.Currency = currency;
|
||||||
|
this.PhotoUrl = photoUrl;
|
||||||
|
this.BannerUrl = bannerUrl;
|
||||||
|
this.LastOnline = lastOnline;
|
||||||
|
this.Biography = biography;
|
||||||
|
this.ViewCount = viewCount;
|
||||||
|
this.Created = created;
|
||||||
|
this.Updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Id
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Uuid
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "uuid", EmitDefaultValue = false)]
|
||||||
|
public Guid Uuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Name
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "name", EmitDefaultValue = true)]
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets DisplayName
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "display_name", EmitDefaultValue = true)]
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Email
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "email", EmitDefaultValue = true)]
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Flags
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "flags", EmitDefaultValue = false)]
|
||||||
|
public string Flags { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Permissions
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "permissions", EmitDefaultValue = false)]
|
||||||
|
public string Permissions { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Verified
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "verified", EmitDefaultValue = true)]
|
||||||
|
public bool Verified { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Level
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "level", EmitDefaultValue = false)]
|
||||||
|
public int Level { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Experience
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "experience", EmitDefaultValue = false)]
|
||||||
|
public double Experience { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PublicBirthday
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "public_birthday", EmitDefaultValue = true)]
|
||||||
|
public bool PublicBirthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Birthday
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "birthday", EmitDefaultValue = true)]
|
||||||
|
public DateOnly? Birthday { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Points
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "points", EmitDefaultValue = false)]
|
||||||
|
public double Points { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Location
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "location", EmitDefaultValue = true)]
|
||||||
|
public string Location { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Language
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "language", EmitDefaultValue = true)]
|
||||||
|
public string Language { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Timezone
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "timezone", EmitDefaultValue = true)]
|
||||||
|
public string Timezone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Currency
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "currency", EmitDefaultValue = true)]
|
||||||
|
public string Currency { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets PhotoUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "photo_url", EmitDefaultValue = true)]
|
||||||
|
public string PhotoUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets BannerUrl
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "banner_url", EmitDefaultValue = true)]
|
||||||
|
public string BannerUrl { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets LastOnline
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "last_online", EmitDefaultValue = true)]
|
||||||
|
public DateTime? LastOnline { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Biography
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "biography", EmitDefaultValue = true)]
|
||||||
|
public string Biography { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets ViewCount
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "view_count", EmitDefaultValue = false)]
|
||||||
|
public int ViewCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Created
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "created", EmitDefaultValue = false)]
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or Sets Updated
|
||||||
|
/// </summary>
|
||||||
|
[DataMember(Name = "updated", EmitDefaultValue = true)]
|
||||||
|
public DateTime? Updated { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>String presentation of the object</returns>
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.Append("class UserInfo {\n");
|
||||||
|
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||||
|
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
|
||||||
|
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||||
|
sb.Append(" DisplayName: ").Append(DisplayName).Append("\n");
|
||||||
|
sb.Append(" Email: ").Append(Email).Append("\n");
|
||||||
|
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||||
|
sb.Append(" Flags: ").Append(Flags).Append("\n");
|
||||||
|
sb.Append(" Permissions: ").Append(Permissions).Append("\n");
|
||||||
|
sb.Append(" Verified: ").Append(Verified).Append("\n");
|
||||||
|
sb.Append(" Level: ").Append(Level).Append("\n");
|
||||||
|
sb.Append(" Experience: ").Append(Experience).Append("\n");
|
||||||
|
sb.Append(" PublicBirthday: ").Append(PublicBirthday).Append("\n");
|
||||||
|
sb.Append(" Birthday: ").Append(Birthday).Append("\n");
|
||||||
|
sb.Append(" Points: ").Append(Points).Append("\n");
|
||||||
|
sb.Append(" Location: ").Append(Location).Append("\n");
|
||||||
|
sb.Append(" Language: ").Append(Language).Append("\n");
|
||||||
|
sb.Append(" Timezone: ").Append(Timezone).Append("\n");
|
||||||
|
sb.Append(" Currency: ").Append(Currency).Append("\n");
|
||||||
|
sb.Append(" PhotoUrl: ").Append(PhotoUrl).Append("\n");
|
||||||
|
sb.Append(" BannerUrl: ").Append(BannerUrl).Append("\n");
|
||||||
|
sb.Append(" LastOnline: ").Append(LastOnline).Append("\n");
|
||||||
|
sb.Append(" Biography: ").Append(Biography).Append("\n");
|
||||||
|
sb.Append(" ViewCount: ").Append(ViewCount).Append("\n");
|
||||||
|
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||||
|
sb.Append(" Updated: ").Append(Updated).Append("\n");
|
||||||
|
sb.Append("}\n");
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the JSON string presentation of the object
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
|
public virtual string ToJson()
|
||||||
|
{
|
||||||
|
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// To validate all properties of the instance
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="validationContext">Validation context</param>
|
||||||
|
/// <returns>Validation Result</returns>
|
||||||
|
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
|
{
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
src/Tribufu.Generated/Model/UserType.cs
Normal file
48
src/Tribufu.Generated/Model/UserType.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Tribufu API
|
||||||
|
*
|
||||||
|
* REST API to access Tribufu services.
|
||||||
|
*
|
||||||
|
* The version of the OpenAPI document: 1.1.0
|
||||||
|
* Contact: contact@tribufu.com
|
||||||
|
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using OpenAPIDateConverter = Tribufu.Generated.Client.OpenAPIDateConverter;
|
||||||
|
|
||||||
|
namespace Tribufu.Generated.Model
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Defines UserType
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(StringEnumConverter))]
|
||||||
|
public enum UserType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum User for value: user
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "user")]
|
||||||
|
User,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enum Bot for value: bot
|
||||||
|
/// </summary>
|
||||||
|
[EnumMember(Value = "bot")]
|
||||||
|
Bot
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
26
src/Tribufu.Generated/Tribufu.Generated.csproj
Normal file
26
src/Tribufu.Generated/Tribufu.Generated.csproj
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<PackageId>Tribufu.Generated</PackageId>
|
||||||
|
<Description>Tribufu .NET SDK</Description>
|
||||||
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>annotations</Nullable>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="JsonSubTypes" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" />
|
||||||
|
<PackageReference Include="Polly" />
|
||||||
|
<PackageReference Include="RestSharp" />
|
||||||
|
<PackageReference Include="System.ComponentModel.Annotations" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackageId>Tribufu.Native</PackageId>
|
|
||||||
<Description>Tribufu Native Interop</Description>
|
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="..\..\vendor\win-arm64\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-arm64\native\" />
|
|
||||||
<None Include="..\..\vendor\win-x64\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-x64\native\" />
|
|
||||||
<None Include="..\..\vendor\win-x86\tribufu_sdk.dll" Pack="true" PackagePath="runtimes\win-x86\native\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Tribufu.Native
|
|
||||||
{
|
|
||||||
public class TribufuNative
|
|
||||||
{
|
|
||||||
[DllImport("tribufu_sdk")]
|
|
||||||
public static extern void tribufu_sdk_shutdown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
25
src/Tribufu.SafeCheck/SafeCheckDetections.cs
Normal file
25
src/Tribufu.SafeCheck/SafeCheckDetections.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) Tribufu. All Rights Reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Tribufu.SafeCheck
|
||||||
|
{
|
||||||
|
public class SafeCheckDetections
|
||||||
|
{
|
||||||
|
[JsonProperty("sexy")]
|
||||||
|
public double Sexy { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("porn")]
|
||||||
|
public double Porn { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("neutral")]
|
||||||
|
public double Neutral { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("hentai")]
|
||||||
|
public double Hentai { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("drawing")]
|
||||||
|
public double Drawing { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/Tribufu.SafeCheck/SafeCheckRequest.cs
Normal file
18
src/Tribufu.SafeCheck/SafeCheckRequest.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Tribufu. All Rights Reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Tribufu.SafeCheck
|
||||||
|
{
|
||||||
|
public class SafeCheckRequest
|
||||||
|
{
|
||||||
|
[JsonProperty("image_url")]
|
||||||
|
public string ImageUrl { get; set; }
|
||||||
|
|
||||||
|
public SafeCheckRequest(string imageUrl)
|
||||||
|
{
|
||||||
|
ImageUrl = imageUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
src/Tribufu.SafeCheck/SafeCheckResponse.cs
Normal file
19
src/Tribufu.SafeCheck/SafeCheckResponse.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) Tribufu. All Rights Reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Tribufu.SafeCheck
|
||||||
|
{
|
||||||
|
public class SafecheckResponse
|
||||||
|
{
|
||||||
|
[JsonProperty("safe")]
|
||||||
|
public bool Safe { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("reason")]
|
||||||
|
public string? Reason { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("detections")]
|
||||||
|
public SafeCheckDetections? Detections { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
27
src/Tribufu.SafeCheck/Tribufu.SafeCheck.csproj
Normal file
27
src/Tribufu.SafeCheck/Tribufu.SafeCheck.csproj
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<PackageId>Tribufu.SafeCheck</PackageId>
|
||||||
|
<Description>Tribufu SafeCheck</Description>
|
||||||
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Newtonsoft.Json" />
|
||||||
|
<PackageReference Include="RestSharp" />
|
||||||
|
<PackageReference Include="System.ComponentModel.Annotations" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Tribufu\Tribufu.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
56
src/Tribufu.SafeCheck/TribufuSafeCheck.cs
Normal file
56
src/Tribufu.SafeCheck/TribufuSafeCheck.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
// Copyright (c) Tribufu. All Rights Reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using RestSharp;
|
||||||
|
|
||||||
|
namespace Tribufu.SafeCheck
|
||||||
|
{
|
||||||
|
public sealed class TribufuSafeCheck
|
||||||
|
{
|
||||||
|
private readonly RestClient _client;
|
||||||
|
|
||||||
|
private readonly string? _apiKey;
|
||||||
|
|
||||||
|
public const string DefaultBaseUrl = "https://safecheck.tribufu.com";
|
||||||
|
|
||||||
|
public TribufuSafeCheck(string? apiKey = null, string baseUrl = DefaultBaseUrl)
|
||||||
|
{
|
||||||
|
var options = new RestClientOptions(baseUrl)
|
||||||
|
{
|
||||||
|
UserAgent = TribufuApi.GetUserAgent(),
|
||||||
|
};
|
||||||
|
|
||||||
|
_client = new RestClient(options);
|
||||||
|
_apiKey = apiKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> CheckImageAsync(string imageUrl)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(imageUrl))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Image URL cannot be null or empty.", nameof(imageUrl));
|
||||||
|
}
|
||||||
|
|
||||||
|
var request = new RestRequest("/image", Method.Post);
|
||||||
|
request.AddHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(_apiKey))
|
||||||
|
{
|
||||||
|
request.AddHeader("Authorization", $"ApiKey {_apiKey}");
|
||||||
|
}
|
||||||
|
|
||||||
|
var requestBody = new SafeCheckRequest(imageUrl);
|
||||||
|
request.AddStringBody(JsonConvert.SerializeObject(requestBody), DataFormat.Json);
|
||||||
|
|
||||||
|
var response = await _client.ExecuteAsync(request);
|
||||||
|
if (!response.IsSuccessful)
|
||||||
|
{
|
||||||
|
throw new Exception($"Request failed: {response.StatusCode} - {response.Content}");
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = JsonConvert.DeserializeObject<SafecheckResponse>(response.Content!);
|
||||||
|
return result?.Safe ?? false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Tribufu.Serialization.Newtonsoft
|
|
||||||
{
|
|
||||||
public class DecimalStringConverter : JsonConverter<decimal>
|
|
||||||
{
|
|
||||||
public override decimal ReadJson(JsonReader reader, Type objectType, decimal existingValue, bool hasExistingValue, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
return decimal.Parse(reader.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void WriteJson(JsonWriter writer, decimal value, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
writer.WriteValue(value.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Tribufu.Serialization.Newtonsoft
|
|
||||||
{
|
|
||||||
public class LongStringConverter : JsonConverter<ulong>
|
|
||||||
{
|
|
||||||
public override ulong ReadJson(JsonReader reader, Type objectType, ulong existingValue, bool hasExistingValue, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
return ulong.Parse(reader.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void WriteJson(JsonWriter writer, ulong value, JsonSerializer serializer)
|
|
||||||
{
|
|
||||||
writer.WriteValue(value.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Tribufu
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackageId>Tribufu.Serialization.Newtonsoft</PackageId>
|
|
||||||
<Description>Tribufu Serialization Helpers for Newtonsoft.Json</Description>
|
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Newtonsoft.Json" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Tribufu.Serialization
|
|
||||||
{
|
|
||||||
public class DecimalStringConverter : JsonConverter<decimal>
|
|
||||||
{
|
|
||||||
public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
||||||
{
|
|
||||||
return Convert.ToUInt64(reader.GetString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options)
|
|
||||||
{
|
|
||||||
writer.WriteStringValue(value.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Tribufu.Serialization
|
|
||||||
{
|
|
||||||
public class LongStringConverter : JsonConverter<ulong>
|
|
||||||
{
|
|
||||||
public override ulong Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
|
|
||||||
{
|
|
||||||
return Convert.ToUInt64(reader.GetString());
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Write(Utf8JsonWriter writer, ulong value, JsonSerializerOptions options)
|
|
||||||
{
|
|
||||||
writer.WriteStringValue(value.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Tribufu
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackageId>Tribufu.Serialization</PackageId>
|
|
||||||
<Description>Tribufu Serialization Helpers</Description>
|
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
# Tribufu
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
<PropertyGroup>
|
|
||||||
<PackageId>Tribufu.Utils</PackageId>
|
|
||||||
<Description>Tribufu Utils</Description>
|
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<TargetFrameworks>net5.0</TargetFrameworks>
|
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace Tribufu.Utils
|
|
||||||
{
|
|
||||||
public static class TribufuAppContext
|
|
||||||
{
|
|
||||||
public static string GetBaseDirectory()
|
|
||||||
{
|
|
||||||
string defaultBaseDirectory = AppContext.BaseDirectory;
|
|
||||||
string baseDirectory;
|
|
||||||
|
|
||||||
if (defaultBaseDirectory.Contains("Debug") || defaultBaseDirectory.Contains("Release"))
|
|
||||||
{
|
|
||||||
baseDirectory = Path.Combine(defaultBaseDirectory, "..", "..", "..", "..", "..");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
baseDirectory = Path.Combine(defaultBaseDirectory, "..", "..");
|
|
||||||
}
|
|
||||||
|
|
||||||
baseDirectory = Path.GetFullPath(baseDirectory);
|
|
||||||
|
|
||||||
return baseDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetBinDirectory()
|
|
||||||
{
|
|
||||||
var binDirectory = Path.Combine(GetBaseDirectory(), "bin");
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(RuntimeInformation.RuntimeIdentifier))
|
|
||||||
{
|
|
||||||
binDirectory = Path.Combine(binDirectory, RuntimeInformation.RuntimeIdentifier);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
binDirectory = Path.Combine(binDirectory, "dotnet");
|
|
||||||
}
|
|
||||||
|
|
||||||
return binDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetConfigDirectory()
|
|
||||||
{
|
|
||||||
return Path.Combine(GetBaseDirectory(), "config");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetAssetsDirectory()
|
|
||||||
{
|
|
||||||
return Path.Combine(GetBaseDirectory(), "assets");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetSavedDirectory()
|
|
||||||
{
|
|
||||||
return Path.Combine(GetBaseDirectory(), "saved");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetCacheDirectory()
|
|
||||||
{
|
|
||||||
return Path.Combine(GetSavedDirectory(), "cache");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetLogsDirectory()
|
|
||||||
{
|
|
||||||
return Path.Combine(GetSavedDirectory(), "logs");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +1,22 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PackageId>Tribufu</PackageId>
|
<PackageId>Tribufu</PackageId>
|
||||||
<Description>Tribufu .NET SDK</Description>
|
<Description>Tribufu .NET SDK</Description>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<TargetFrameworks>netstandard2.0;net45;net5.0</TargetFrameworks>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>annotations</Nullable>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<TargetFrameworks>net6.0</TargetFrameworks>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="README.md" Pack="true" PackagePath="\" />
|
<None Include="README.md" Pack="true" PackagePath="\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" />
|
<ProjectReference Include="..\Tribufu.Generated\Tribufu.Generated.csproj" />
|
||||||
<PackageReference Include="System.ComponentModel.Annotations" />
|
|
||||||
<PackageReference Include="System.Net.Http" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\Tribufu.Native\Tribufu.Native.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,14 +1,170 @@
|
|||||||
// Copyright (c) Tribufu. All Rights Reserved.
|
// Copyright (c) Tribufu. All Rights Reserved.
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
using System.Net.Http;
|
using System.Net;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using Tribufu.Generated.Api;
|
||||||
|
using Tribufu.Generated.Client;
|
||||||
|
|
||||||
namespace Tribufu
|
namespace Tribufu
|
||||||
{
|
{
|
||||||
public class TribufuApi : TribufuApiGenerated
|
/// <summary>
|
||||||
|
/// Tribufu API
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Use this class to interact with the Tribufu API.
|
||||||
|
/// </remarks>
|
||||||
|
public sealed class TribufuApi : TribufuGeneratedApi
|
||||||
{
|
{
|
||||||
public TribufuApi(TribufuApiOptions options) : base(options.BaseUrl, new HttpClient())
|
/// <summary>
|
||||||
|
/// The default base URL for the Tribufu API.
|
||||||
|
/// </summary>
|
||||||
|
public const string DefaultBaseUrl = "https://api.tribufu.com";
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a <see cref="TribufuApi"/> instance.
|
||||||
|
/// </summary>
|
||||||
|
public TribufuApi(string? apiKey = null) : base(CreateConfiguration(apiKey))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a TribufuApi with the default options.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>TribufuApi instance with default configuration</returns>
|
||||||
|
public static TribufuApi Default()
|
||||||
|
{
|
||||||
|
return new TribufuApi();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a <see cref="TribufuApi"/> with the given API key.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// A API key gives you public read only access to the Tribufu API.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="apiKey">The API key for authentication</param>
|
||||||
|
/// <returns><see cref="TribufuApi"/> instance configured with the API key</returns>
|
||||||
|
public static TribufuApi WithApiKey(string apiKey)
|
||||||
|
{
|
||||||
|
return new TribufuApi(apiKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Try to create a <see cref="TribufuApi"/> from environment variables.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This will only work if the environment variables are set.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="prefix">A prefix for the environment variables. Default is "TRIBUFU".</param>
|
||||||
|
/// <returns><see cref="TribufuApi"/> instance or null if environment variables not set</returns>
|
||||||
|
/// <example>
|
||||||
|
/// // Environment variable TRIBUFU_API_KEY must be set
|
||||||
|
/// var api = TribufuApi.FromEnv();
|
||||||
|
/// </example>
|
||||||
|
public static TribufuApi? FromEnv(string? prefix = null)
|
||||||
|
{
|
||||||
|
prefix ??= "TRIBUFU";
|
||||||
|
|
||||||
|
var apiKey = Environment.GetEnvironmentVariable($"{prefix}_API_KEY");
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(apiKey))
|
||||||
|
{
|
||||||
|
return WithApiKey(apiKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create a <see cref="TribufuApi"/> from environment variables or the default API.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This will fallback to the default API if the environment variables are not set.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="prefix">A prefix for the environment variables. Default is "TRIBUFU".</param>
|
||||||
|
/// <returns><see cref="TribufuApi"/> instance</returns>
|
||||||
|
/// <example>
|
||||||
|
/// // Environment variable TRIBUFU_API_KEY might be unset
|
||||||
|
/// var api = TribufuApi.FromEnvOrDefault();
|
||||||
|
/// </example>
|
||||||
|
public static TribufuApi FromEnvOrDefault(string prefix = "TRIBUFU")
|
||||||
|
{
|
||||||
|
return FromEnv(prefix) ?? Default();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the version of the Tribufu API client.
|
||||||
|
/// </summary>
|
||||||
|
public static string GetVersion()
|
||||||
|
{
|
||||||
|
var version = typeof(TribufuApi).Assembly.GetName().Version;
|
||||||
|
return $"{version?.Major}.{version?.Minor}.{version?.Build}";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the user agent string for the Tribufu API client.
|
||||||
|
/// </summary>
|
||||||
|
public static string GetUserAgent()
|
||||||
|
{
|
||||||
|
var version = GetVersion();
|
||||||
|
var frameworkDescription = RuntimeInformation.FrameworkDescription.Trim();
|
||||||
|
var runtimeIdentifier = RuntimeInformation.RuntimeIdentifier.Trim();
|
||||||
|
return $"Tribufu/{version} ({frameworkDescription}; {runtimeIdentifier})";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if debug mode is enabled.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>True if debug mode is enabled, otherwise false</returns>
|
||||||
|
public static bool DebugEnabled()
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get the base URL for the Tribufu API.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// The base URL can be set using the environment variable TRIBUFU_API_URL.
|
||||||
|
/// The custom base URL is only used if debug mode is enabled.
|
||||||
|
/// The default base URL is https://api.tribufu.com.
|
||||||
|
/// </remarks>
|
||||||
|
/// <returns>Base URL string</returns>
|
||||||
|
private static string GetBaseUrl()
|
||||||
|
{
|
||||||
|
var baseUrl = Environment.GetEnvironmentVariable("TRIBUFU_API_URL");
|
||||||
|
|
||||||
|
if (DebugEnabled() && !string.IsNullOrEmpty(baseUrl))
|
||||||
|
{
|
||||||
|
return baseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DefaultBaseUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a configuration for the Tribufu API client.
|
||||||
|
/// </summary>
|
||||||
|
private static Configuration CreateConfiguration(string? apiKey)
|
||||||
|
{
|
||||||
|
var config = new Configuration
|
||||||
|
{
|
||||||
|
BasePath = GetBaseUrl(),
|
||||||
|
UserAgent = WebUtility.UrlEncode(GetUserAgent()),
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(apiKey))
|
||||||
|
{
|
||||||
|
config.AddApiKeyPrefix("Authorization", "ApiKey");
|
||||||
|
config.AddApiKey("Authorization", apiKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user