From 9bb3b987fb7bff78fbdb765c725833b77a43407d Mon Sep 17 00:00:00 2001 From: Ethan Celletti Date: Mon, 9 Oct 2023 00:27:05 +0200 Subject: [PATCH] Reverting and adding [CandidOptional] (#106) --- src/Candid/API.md | 22 +- src/Candid/API.xml | 12 +- src/Candid/CandidConverter.cs | 2 +- src/Candid/CandidConverterOptions.cs | 5 - src/Candid/Mapping/IResolvableTypeInfo.cs | 56 +- src/Candid/Mapping/MapperAttributes.cs | 10 + .../Mapping/Mappers/NullableValueMapper.cs | 50 - src/Candid/Mapping/Mappers/RecordMapper.cs | 22 +- src/ClientGenerator/API.md | 17 +- src/ClientGenerator/API.xml | 10 +- src/ClientGenerator/ClientCodeGenerator.cs | 5 +- .../ClientGenerationOptions.cs | 9 - src/ClientGenerator/RoslynTypeResolver.cs | 68 +- src/ClientGenerator/TomlConfigParser.cs | 1 - src/ClientGenerator/TypeName.cs | 94 +- test/Candid.Tests/Candid.Tests.csproj | 4 + test/Candid.Tests/CandidConverterTests.cs | 87 +- .../Generators/ClientGeneratorTests.cs | 54 +- ...se_False_VariantsUseProperties_False.snap} | 0 ...ase_False_VariantsUseProperties_True.snap} | 0 ...ase_True_VariantsUseProperties_False.snap} | 0 ...Case_True_VariantsUseProperties_True.snap} | 0 ...se_False_VariantsUseProperties_False.snap} | 0 ...ase_False_VariantsUseProperties_True.snap} | 0 ...ase_True_VariantsUseProperties_False.snap} | 0 ...Case_True_VariantsUseProperties_True.snap} | 0 ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 41 - ...roperties_False_UseOptionalValue_True.snap | 41 - ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 41 - ...Properties_True_UseOptionalValue_True.snap | 41 - ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 41 - ...roperties_False_UseOptionalValue_True.snap | 41 - ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 41 - ...Properties_True_UseOptionalValue_True.snap | 41 - ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 41 - ...roperties_False_UseOptionalValue_True.snap | 41 - ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 41 - ...Properties_True_UseOptionalValue_True.snap | 41 - ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 41 - ...roperties_False_UseOptionalValue_True.snap | 41 - ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 41 - ...Properties_True_UseOptionalValue_True.snap | 41 - ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 512 --- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 404 -- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 501 --- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 393 -- ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 512 --- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 404 -- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 501 --- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 393 -- ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 512 --- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 404 -- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 501 --- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 393 -- ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 512 --- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 404 -- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 501 --- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 393 -- ...se_False_VariantsUseProperties_False.snap} | 0 ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 59 - ...Properties_True_UseOptionalValue_True.snap | 59 - ...ase_True_VariantsUseProperties_False.snap} | 0 ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 55 - ...Properties_True_UseOptionalValue_True.snap | 55 - ...se_False_VariantsUseProperties_False.snap} | 0 ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 59 - ...Properties_True_UseOptionalValue_True.snap | 59 - ...ase_True_VariantsUseProperties_False.snap} | 0 ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 55 - ...Properties_True_UseOptionalValue_True.snap | 55 - ...se_False_VariantsUseProperties_False.snap} | 0 ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 59 - ...Properties_True_UseOptionalValue_True.snap | 59 - ...ase_True_VariantsUseProperties_False.snap} | 0 ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 55 - ...Properties_True_UseOptionalValue_True.snap | 55 - ...se_False_VariantsUseProperties_False.snap} | 0 ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 59 - ...Properties_True_UseOptionalValue_True.snap | 59 - ...ase_True_VariantsUseProperties_False.snap} | 0 ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 55 - ...Properties_True_UseOptionalValue_True.snap | 55 - ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3688 ----------------- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2909 ------------- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3418 --------------- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2639 ------------ ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3688 ----------------- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2909 ------------- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3418 --------------- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2639 ------------ ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3688 ----------------- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2909 ------------- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3418 --------------- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2639 ------------ ...se_False_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3688 ----------------- ...ase_False_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2909 ------------- ...ase_True_VariantsUseProperties_False.snap} | 0 ...operties_False_UseOptionalValue_False.snap | 3418 --------------- ...Case_True_VariantsUseProperties_True.snap} | 0 ...roperties_True_UseOptionalValue_False.snap | 2639 ------------ 146 files changed, 201 insertions(+), 59751 deletions(-) delete mode 100644 src/Candid/Mapping/Mappers/NullableValueMapper.cs rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap => AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap => DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) rename test/Candid.Tests/Generators/__snapshots__/{DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap delete mode 100644 test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename test/Candid.Tests/Generators/__snapshots__/{Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap => Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap} (100%) delete mode 100644 test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap diff --git a/src/Candid/API.md b/src/Candid/API.md index 9df55ee3..bd38f41c 100644 --- a/src/Candid/API.md +++ b/src/Candid/API.md @@ -46,7 +46,6 @@ - [ToOptionalObject\`\`1(value)](#M-EdjCase-ICP-Candid-CandidConverter-ToOptionalObject``1-EdjCase-ICP-Candid-Models-Values-CandidOptional- 'EdjCase.ICP.Candid.CandidConverter.ToOptionalObject``1(EdjCase.ICP.Candid.Models.Values.CandidOptional)') - [CandidConverterOptions](#T-EdjCase-ICP-Candid-CandidConverterOptions 'EdjCase.ICP.Candid.CandidConverterOptions') - [CustomMappers](#P-EdjCase-ICP-Candid-CandidConverterOptions-CustomMappers 'EdjCase.ICP.Candid.CandidConverterOptions.CustomMappers') - - [UseOptionalValue](#P-EdjCase-ICP-Candid-CandidConverterOptions-UseOptionalValue 'EdjCase.ICP.Candid.CandidConverterOptions.UseOptionalValue') - [AddCustomMapper(mapper)](#M-EdjCase-ICP-Candid-CandidConverterOptions-AddCustomMapper-EdjCase-ICP-Candid-Mapping-ICandidValueMapper- 'EdjCase.ICP.Candid.CandidConverterOptions.AddCustomMapper(EdjCase.ICP.Candid.Mapping.ICandidValueMapper)') - [AddCustomMapper\`\`1()](#M-EdjCase-ICP-Candid-CandidConverterOptions-AddCustomMapper``1 'EdjCase.ICP.Candid.CandidConverterOptions.AddCustomMapper``1') - [CandidDecodingException](#T-EdjCase-ICP-Candid-Exceptions-CandidDecodingException 'EdjCase.ICP.Candid.Exceptions.CandidDecodingException') @@ -96,6 +95,7 @@ - [Equals()](#M-EdjCase-ICP-Candid-Models-Values-CandidOptional-Equals-EdjCase-ICP-Candid-Models-Values-CandidValue- 'EdjCase.ICP.Candid.Models.Values.CandidOptional.Equals(EdjCase.ICP.Candid.Models.Values.CandidValue)') - [GetHashCode()](#M-EdjCase-ICP-Candid-Models-Values-CandidOptional-GetHashCode 'EdjCase.ICP.Candid.Models.Values.CandidOptional.GetHashCode') - [ToString()](#M-EdjCase-ICP-Candid-Models-Values-CandidOptional-ToString 'EdjCase.ICP.Candid.Models.Values.CandidOptional.ToString') +- [CandidOptionalAttribute](#T-EdjCase-ICP-Candid-Mapping-CandidOptionalAttribute 'EdjCase.ICP.Candid.Mapping.CandidOptionalAttribute') - [CandidOptionalType](#T-EdjCase-ICP-Candid-Models-Types-CandidOptionalType 'EdjCase.ICP.Candid.Models.Types.CandidOptionalType') - [#ctor(value,recursiveId)](#M-EdjCase-ICP-Candid-Models-Types-CandidOptionalType-#ctor-EdjCase-ICP-Candid-Models-Types-CandidType,EdjCase-ICP-Candid-Models-CandidId- 'EdjCase.ICP.Candid.Models.Types.CandidOptionalType.#ctor(EdjCase.ICP.Candid.Models.Types.CandidType,EdjCase.ICP.Candid.Models.CandidId)') - [Type](#P-EdjCase-ICP-Candid-Models-Types-CandidOptionalType-Type 'EdjCase.ICP.Candid.Models.Types.CandidOptionalType.Type') @@ -1384,14 +1384,6 @@ Options for configuring how candid is convertered List of custom mappers to use instead of the default mappers provided. Order does matter, FIFO - -### UseOptionalValue `property` - -##### Summary - -If true, will use treat OptionalValue types as opt in candid -otherwise will treat all nullable/class types opt in candid - ### AddCustomMapper(mapper) `method` @@ -1918,6 +1910,18 @@ This method has no parameters. This method has no parameters. + +## CandidOptionalAttribute `type` + +##### Namespace + +EdjCase.ICP.Candid.Mapping + +##### Summary + +An attribute to use the raw nullable value vs OptionalValue type +E.g. OptionalValue of string, can be a string with this attribute + ## CandidOptionalType `type` diff --git a/src/Candid/API.xml b/src/Candid/API.xml index 54bcdccc..8a15b301 100644 --- a/src/Candid/API.xml +++ b/src/Candid/API.xml @@ -72,12 +72,6 @@ Options for configuring how candid is convertered - - - If true, will use treat OptionalValue types as opt in candid - otherwise will treat all nullable/class types opt in candid - - List of custom mappers to use instead of the default mappers provided. @@ -464,6 +458,12 @@ An attribute to ignore a property/field of a class during serialization + + + An attribute to use the raw nullable value vs OptionalValue type + E.g. OptionalValue of string, can be a string with this attribute + + An attribute to put on a class to identify it as a variant type for serialization. diff --git a/src/Candid/CandidConverter.cs b/src/Candid/CandidConverter.cs index 263374ed..039b6e75 100644 --- a/src/Candid/CandidConverter.cs +++ b/src/Candid/CandidConverter.cs @@ -152,7 +152,7 @@ private ICandidValueMapper ResolveUncached(Type type) return mapper == null // Create a dynamic mapper if no custom one - ? DefaultMapperFactory.Build(type, this._options.UseOptionalValue) + ? DefaultMapperFactory.Build(type) : mapper; } diff --git a/src/Candid/CandidConverterOptions.cs b/src/Candid/CandidConverterOptions.cs index dfc8836b..a362917f 100644 --- a/src/Candid/CandidConverterOptions.cs +++ b/src/Candid/CandidConverterOptions.cs @@ -12,11 +12,6 @@ namespace EdjCase.ICP.Candid /// public class CandidConverterOptions { - /// - /// If true, will use treat OptionalValue types as opt in candid - /// otherwise will treat all nullable/class types opt in candid - /// - public bool UseOptionalValue { get; set; } = true; /// /// List of custom mappers to use instead of the default mappers provided. /// Order does matter, FIFO diff --git a/src/Candid/Mapping/IResolvableTypeInfo.cs b/src/Candid/Mapping/IResolvableTypeInfo.cs index f8838fb0..513df021 100644 --- a/src/Candid/Mapping/IResolvableTypeInfo.cs +++ b/src/Candid/Mapping/IResolvableTypeInfo.cs @@ -67,17 +67,16 @@ public ComplexTypeInfo(Type objType, List dependencies, ResolveMapper reso internal static class DefaultMapperFactory { - public static ICandidValueMapper Build(Type objType, bool useOptionalValue) + public static ICandidValueMapper Build(Type objType) { Dictionary resolvedDependencies = new(); - return ResolveDependencies(objType, resolvedDependencies, useOptionalValue); + return ResolveDependencies(objType, resolvedDependencies); } private static ICandidValueMapper ResolveDependencies( Type objType, - Dictionary resolvedDependencies, - bool useOptionalValue + Dictionary resolvedDependencies ) { IResolvableTypeInfo info = BuildTypeInfo(objType); @@ -94,25 +93,12 @@ bool useOptionalValue // Skip already resolved dependencies continue; } - ResolveDependencies(depType, resolvedDependencies, useOptionalValue); + ResolveDependencies(depType, resolvedDependencies); } } (ICandidValueMapper objectMapper, CandidType type) = info.Resolve(resolvedDependencies); - if (!useOptionalValue) - { - bool isOptionalValue = info.ObjType.IsGenericType - && info.ObjType.GetGenericTypeDefinition() == typeof(OptionalValue<>); - if (!isOptionalValue && !info.ObjType.IsValueType) - { - // If type is nullable, not OptionalValue and has the - // useOptionalValue as false, then treat each nullable type - // as an opt in candid - objectMapper = new NullableValueMapper(objectMapper); - type = new CandidOptionalType(type); - } - } - + resolvedDependencies[objType] = type; return objectMapper; } @@ -285,7 +271,7 @@ private static IResolvableTypeInfo BuildTypeInfo(Type objType) } // Enum variant - if(objType.IsEnum) + if (objType.IsEnum) { return BuildEnumVariant(objType); } @@ -420,7 +406,7 @@ Type valueType { CandidType keyCandidType = resolvedMappings[keyType]; CandidType valueCandidType = resolvedMappings[valueType]; - Dictionary fields = new() + Dictionary fields = new() { [0] = keyCandidType, [1] = valueCandidType @@ -492,7 +478,7 @@ private static IResolvableTypeInfo BuildVariant(Type objType, VariantAttribute a ); var optionTypes = new Dictionary(); - foreach(MethodInfo classMethod in objType.GetMethods(BindingFlags.Instance | BindingFlags.Public)) + foreach (MethodInfo classMethod in objType.GetMethods(BindingFlags.Instance | BindingFlags.Public)) { CandidTag tag; var optionAttribute = classMethod.GetCustomAttribute(); @@ -508,12 +494,12 @@ private static IResolvableTypeInfo BuildVariant(Type objType, VariantAttribute a { continue; } - + optionTypes.Add(tag, classMethod.ReturnType); } - foreach(PropertyInfo property in properties) + foreach (PropertyInfo property in properties) { - if(property == variantTagProperty || property == valueProperty) + if (property == variantTagProperty || property == valueProperty) { // Skip tag and value properties continue; @@ -633,11 +619,12 @@ private static IResolvableTypeInfo BuildRecord(Type objType) { tag = CandidTag.FromName(property.Name); } - PropertyMetaData propertyMetaData = new(property, CustomMapper: null); // TODO attribute custom mapper + CandidOptionalAttribute? optionalAttribute = property.GetCustomAttribute(); + bool useOptionalOverride = optionalAttribute != null; + PropertyMetaData propertyMetaData = new(property, useOptionalOverride); propertyMetaDataMap.Add(tag, propertyMetaData); } List dependencies = propertyMetaDataMap - .Where(p => p.Value.CustomMapper == null) // Only resolve the ones that need to .Select(p => p.Value.PropertyInfo.PropertyType) .ToList(); return new ComplexTypeInfo(objType, dependencies, (resolvedMappings) => @@ -647,16 +634,13 @@ private static IResolvableTypeInfo BuildRecord(Type objType) p => p.Key, p => { - if (p.Value.CustomMapper != null) + CandidType type = resolvedMappings[p.Value.PropertyInfo.PropertyType]; + if (p.Value.UseOptionalOverride) { - CandidType? type = p.Value.CustomMapper!.GetMappedCandidType(p.Value.PropertyInfo.PropertyType); - if (type == null) - { - throw new InvalidOperationException($"Property '{p.Value.PropertyInfo.Name}' given incompatible candid value mapper"); - } - return type; + // Property is really optional type + type = new CandidOptionalType(type); } - return resolvedMappings[p.Value.PropertyInfo.PropertyType]; + return type; } ); CandidRecordType type = new CandidRecordType(fieldTypes); @@ -668,7 +652,7 @@ private static IResolvableTypeInfo BuildRecord(Type objType) } internal record PropertyMetaData( PropertyInfo PropertyInfo, - ICandidValueMapper? CustomMapper + bool UseOptionalOverride ); diff --git a/src/Candid/Mapping/MapperAttributes.cs b/src/Candid/Mapping/MapperAttributes.cs index 81a84c38..7c3abad4 100644 --- a/src/Candid/Mapping/MapperAttributes.cs +++ b/src/Candid/Mapping/MapperAttributes.cs @@ -55,6 +55,16 @@ public class CandidIgnoreAttribute : Attribute { } + /// + /// An attribute to use the raw nullable value vs OptionalValue type + /// E.g. OptionalValue of string, can be a string with this attribute + /// + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CandidOptionalAttribute : Attribute + { + + } + /// /// An attribute to put on a class to identify it as a variant type for serialization. /// Requires the use of `VariantTagPropertyAttribute`, `VariantOptionTypeAttribute` and diff --git a/src/Candid/Mapping/Mappers/NullableValueMapper.cs b/src/Candid/Mapping/Mappers/NullableValueMapper.cs deleted file mode 100644 index b7e11a13..00000000 --- a/src/Candid/Mapping/Mappers/NullableValueMapper.cs +++ /dev/null @@ -1,50 +0,0 @@ -using EdjCase.ICP.Candid.Models.Types; -using EdjCase.ICP.Candid.Models.Values; -using System; -using System.Collections.Generic; -using System.Text; - -namespace EdjCase.ICP.Candid.Mapping.Mappers -{ - internal class NullableValueMapper : ICandidValueMapper - { - public ICandidValueMapper InnerValueMapper { get; } - public NullableValueMapper(ICandidValueMapper innerValueMapper) - { - this.InnerValueMapper = innerValueMapper ?? throw new ArgumentNullException(nameof(innerValueMapper)); - } - - - public CandidType? GetMappedCandidType(Type type) - { - return this.InnerValueMapper.GetMappedCandidType(type); - } - - public object Map(CandidValue value, CandidConverter converter) - { - CandidValue innerValue; - if (value is CandidOptional o) - { - if (o.IsNull()) - { - return null!; - } - innerValue = o.Value; - } - else - { - innerValue = value; - } - return this.InnerValueMapper.Map(innerValue, converter); - } - - public CandidValue Map(object value, CandidConverter converter) - { - if (value == null) - { - return CandidValue.Null(); - } - return this.InnerValueMapper.Map(value, converter); - } - } -} diff --git a/src/Candid/Mapping/Mappers/RecordMapper.cs b/src/Candid/Mapping/Mappers/RecordMapper.cs index 7524899e..2f154008 100644 --- a/src/Candid/Mapping/Mappers/RecordMapper.cs +++ b/src/Candid/Mapping/Mappers/RecordMapper.cs @@ -34,7 +34,7 @@ public object Map(CandidValue value, CandidConverter converter) // Record has property that is not in the candid type, skip continue; } - if (fieldType is not CandidOptionalType) + if (fieldType is not CandidOptionalType && !property.UseOptionalOverride) { // Only throw if fieldType is not an opt value since the value is unset (null) // or has an extra @@ -43,14 +43,7 @@ public object Map(CandidValue value, CandidConverter converter) // Set to optional value if not specified in record fieldCandidValue = new CandidOptional(null); } - if (property.CustomMapper != null) - { - fieldValue = property.CustomMapper.Map(fieldCandidValue, converter); - } - else - { - fieldValue = converter.ToObject(property.PropertyInfo.PropertyType, fieldCandidValue); - } + fieldValue = converter.ToObject(property.PropertyInfo.PropertyType, fieldCandidValue); property.PropertyInfo.SetValue(obj, fieldValue); } return obj; @@ -61,19 +54,20 @@ public CandidValue Map(object value, CandidConverter converter) Dictionary fields = new(); foreach ((CandidTag tag, PropertyMetaData property) in this.Properties) { - object propValue = property.PropertyInfo.GetValue(value); + object? propValue = property.PropertyInfo.GetValue(value); CandidValue v; if (propValue == null) { v = new CandidOptional(null); } - else if (property.CustomMapper != null) - { - v = property.CustomMapper.Map(propValue, converter); - } else { v = converter.FromObject(propValue); + if (property.UseOptionalOverride) + { + // Wrap in candid optional if has override [CandidOptional] + v = new CandidOptional(v); + } } fields.Add(tag, v); } diff --git a/src/ClientGenerator/API.md b/src/ClientGenerator/API.md index 62700c2e..6af28af9 100644 --- a/src/ClientGenerator/API.md +++ b/src/ClientGenerator/API.md @@ -8,7 +8,7 @@ - [GenerateClientFromCanisterAsync(canisterId,options)](#M-EdjCase-ICP-ClientGenerator-ClientCodeGenerator-GenerateClientFromCanisterAsync-EdjCase-ICP-Candid-Models-Principal,EdjCase-ICP-ClientGenerator-ClientGenerationOptions- 'EdjCase.ICP.ClientGenerator.ClientCodeGenerator.GenerateClientFromCanisterAsync(EdjCase.ICP.Candid.Models.Principal,EdjCase.ICP.ClientGenerator.ClientGenerationOptions)') - [GenerateClientFromFile(fileText,options)](#M-EdjCase-ICP-ClientGenerator-ClientCodeGenerator-GenerateClientFromFile-System-String,EdjCase-ICP-ClientGenerator-ClientGenerationOptions- 'EdjCase.ICP.ClientGenerator.ClientCodeGenerator.GenerateClientFromFile(System.String,EdjCase.ICP.ClientGenerator.ClientGenerationOptions)') - [ClientGenerationOptions](#T-EdjCase-ICP-ClientGenerator-ClientGenerationOptions 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions') - - [#ctor(name,namespace,getDefinitionFromCanister,filePathOrCandidId,outputDirectory,purgeOutputDirectory,noFolders,featureNullable,variantsUseProperties,keepCandidCase,useOptionalValue,boundryNodeUrl,types)](#M-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-#ctor-System-String,System-String,System-Boolean,System-String,System-String,System-Boolean,System-Boolean,System-Boolean,System-Boolean,System-Boolean,System-Boolean,System-Uri,System-Collections-Generic-Dictionary{System-String,EdjCase-ICP-ClientGenerator-NamedTypeOptions}- 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.#ctor(System.String,System.String,System.Boolean,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Uri,System.Collections.Generic.Dictionary{System.String,EdjCase.ICP.ClientGenerator.NamedTypeOptions})') + - [#ctor(name,namespace,getDefinitionFromCanister,filePathOrCandidId,outputDirectory,purgeOutputDirectory,noFolders,featureNullable,variantsUseProperties,keepCandidCase,boundryNodeUrl,types)](#M-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-#ctor-System-String,System-String,System-Boolean,System-String,System-String,System-Boolean,System-Boolean,System-Boolean,System-Boolean,System-Boolean,System-Uri,System-Collections-Generic-Dictionary{System-String,EdjCase-ICP-ClientGenerator-NamedTypeOptions}- 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.#ctor(System.String,System.String,System.Boolean,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Uri,System.Collections.Generic.Dictionary{System.String,EdjCase.ICP.ClientGenerator.NamedTypeOptions})') - [BoundryNodeUrl](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-BoundryNodeUrl 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.BoundryNodeUrl') - [FeatureNullable](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-FeatureNullable 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.FeatureNullable') - [FilePathOrCanisterId](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-FilePathOrCanisterId 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.FilePathOrCanisterId') @@ -20,7 +20,6 @@ - [OutputDirectory](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-OutputDirectory 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.OutputDirectory') - [PurgeOutputDirectory](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-PurgeOutputDirectory 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.PurgeOutputDirectory') - [Types](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-Types 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.Types') - - [UseOptionalValue](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-UseOptionalValue 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.UseOptionalValue') - [VariantsUseProperties](#P-EdjCase-ICP-ClientGenerator-ClientGenerationOptions-VariantsUseProperties 'EdjCase.ICP.ClientGenerator.ClientGenerationOptions.VariantsUseProperties') - [ClientSyntax](#T-EdjCase-ICP-ClientGenerator-ClientSyntax 'EdjCase.ICP.ClientGenerator.ClientSyntax') - [#ctor(name,clientFile,typeFiles)](#M-EdjCase-ICP-ClientGenerator-ClientSyntax-#ctor-System-String,Microsoft-CodeAnalysis-CSharp-Syntax-CompilationUnitSyntax,System-Collections-Generic-List{System-ValueTuple{System-String,Microsoft-CodeAnalysis-CSharp-Syntax-CompilationUnitSyntax}}- 'EdjCase.ICP.ClientGenerator.ClientSyntax.#ctor(System.String,Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax,System.Collections.Generic.List{System.ValueTuple{System.String,Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax}})') @@ -106,8 +105,8 @@ EdjCase.ICP.ClientGenerator Options for generating a client - -### #ctor(name,namespace,getDefinitionFromCanister,filePathOrCandidId,outputDirectory,purgeOutputDirectory,noFolders,featureNullable,variantsUseProperties,keepCandidCase,useOptionalValue,boundryNodeUrl,types) `constructor` + +### #ctor(name,namespace,getDefinitionFromCanister,filePathOrCandidId,outputDirectory,purgeOutputDirectory,noFolders,featureNullable,variantsUseProperties,keepCandidCase,boundryNodeUrl,types) `constructor` ##### Parameters @@ -123,7 +122,6 @@ Options for generating a client | featureNullable | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | If true, the nullable C# feature will be used | | variantsUseProperties | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | If true, variant classes will be generated with properties instead of methods | | keepCandidCase | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | If true, the names of properties and methods will keep the raw candid name. Otherwise they will be converted to something prettier | -| useOptionalValue | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | If true, OptionalValue will be used for opt values, Otherwise will use just the nullable class values or nullable struct. Defaults to true | | boundryNodeUrl | [System.Uri](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Uri 'System.Uri') | Optional. The url of the boundry node for the internet computer. Defaults to ic0.app | | types | [System.Collections.Generic.Dictionary{System.String,EdjCase.ICP.ClientGenerator.NamedTypeOptions}](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Collections.Generic.Dictionary 'System.Collections.Generic.Dictionary{System.String,EdjCase.ICP.ClientGenerator.NamedTypeOptions}') | Optional. Specifies options for each candid type in the definition | @@ -206,15 +204,6 @@ If true, removes all files in the output directory before regeneration, otherwis Optional. Specifies options for each candid type in the definition. Only supports named types, no anonymous types - -### UseOptionalValue `property` - -##### Summary - -If true, OptionalValue will be used for opt values -Otherwise will use just the nullable class values or nullable struct -Defaults to true - ### VariantsUseProperties `property` diff --git a/src/ClientGenerator/API.xml b/src/ClientGenerator/API.xml index c9a9aaaf..7346d100 100644 --- a/src/ClientGenerator/API.xml +++ b/src/ClientGenerator/API.xml @@ -88,13 +88,6 @@ Otherwise they will be converted to something prettier - - - If true, OptionalValue will be used for opt values - Otherwise will use just the nullable class values or nullable struct - Defaults to true - - Optional. The url of the boundry node for the internet computer. Defaults to ic0.app @@ -106,7 +99,7 @@ Only supports named types, no anonymous types - + The name of the client class and file to use The base namespace to use in the generated files If true, will treat as a canister id and get the definition from the canister. Otherwise will treat it as a file path and get the definition from the file @@ -117,7 +110,6 @@ If true, the nullable C# feature will be used If true, variant classes will be generated with properties instead of methods If true, the names of properties and methods will keep the raw candid name. Otherwise they will be converted to something prettier - If true, OptionalValue will be used for opt values, Otherwise will use just the nullable class values or nullable struct. Defaults to true Optional. The url of the boundry node for the internet computer. Defaults to ic0.app Optional. Specifies options for each candid type in the definition diff --git a/src/ClientGenerator/ClientCodeGenerator.cs b/src/ClientGenerator/ClientCodeGenerator.cs index 714a888a..c048d800 100644 --- a/src/ClientGenerator/ClientCodeGenerator.cs +++ b/src/ClientGenerator/ClientCodeGenerator.cs @@ -103,7 +103,6 @@ ClientGenerationOptions options aliases, options.FeatureNullable, options.VariantsUseProperties, - options.UseOptionalValue, nameHelper, declaredTypes ); @@ -119,7 +118,7 @@ ClientGenerationOptions options Dictionary aliasTypes = aliases .ToDictionary( t => declaredTypes[t].Name, - t => resolvedTypes[t].Name.BuildName(options.FeatureNullable, options.UseOptionalValue, includeNamespace: true, resolveAliases: true) + t => resolvedTypes[t].Name.BuildName(options.FeatureNullable, includeNamespace: true, resolveAliases: true) ); foreach ((string id, ResolvedType typeInfo) in resolvedTypes) { @@ -130,7 +129,7 @@ ClientGenerationOptions options ); if (sourceCode != null) { - typeFiles.Add((typeInfo.Name.BuildName(options.FeatureNullable, options.UseOptionalValue, false), sourceCode)); + typeFiles.Add((typeInfo.Name.BuildName(options.FeatureNullable, false), sourceCode)); } } diff --git a/src/ClientGenerator/ClientGenerationOptions.cs b/src/ClientGenerator/ClientGenerationOptions.cs index 001232b2..acc1f5ca 100644 --- a/src/ClientGenerator/ClientGenerationOptions.cs +++ b/src/ClientGenerator/ClientGenerationOptions.cs @@ -57,12 +57,6 @@ public class ClientGenerationOptions /// public bool KeepCandidCase { get; } /// - /// If true, OptionalValue will be used for opt values - /// Otherwise will use just the nullable class values or nullable struct - /// Defaults to true - /// - public bool UseOptionalValue { get; } - /// /// Optional. The url of the boundry node for the internet computer. Defaults to ic0.app /// public Uri? BoundryNodeUrl { get; } @@ -84,7 +78,6 @@ public class ClientGenerationOptions /// If true, the nullable C# feature will be used /// If true, variant classes will be generated with properties instead of methods /// If true, the names of properties and methods will keep the raw candid name. Otherwise they will be converted to something prettier - /// If true, OptionalValue will be used for opt values, Otherwise will use just the nullable class values or nullable struct. Defaults to true /// Optional. The url of the boundry node for the internet computer. Defaults to ic0.app /// Optional. Specifies options for each candid type in the definition public ClientGenerationOptions( @@ -98,7 +91,6 @@ public ClientGenerationOptions( bool featureNullable = false, bool variantsUseProperties = false, bool keepCandidCase = false, - bool useOptionalValue = true, Uri? boundryNodeUrl = null, Dictionary? types = null ) @@ -118,7 +110,6 @@ public ClientGenerationOptions( this.FeatureNullable = featureNullable; this.VariantsUseProperties = variantsUseProperties; this.KeepCandidCase = keepCandidCase; - this.UseOptionalValue = useOptionalValue; this.BoundryNodeUrl = boundryNodeUrl; this.Types = types ?? new Dictionary(); } diff --git a/src/ClientGenerator/RoslynTypeResolver.cs b/src/ClientGenerator/RoslynTypeResolver.cs index 290d4bf1..afe0a3a6 100644 --- a/src/ClientGenerator/RoslynTypeResolver.cs +++ b/src/ClientGenerator/RoslynTypeResolver.cs @@ -27,7 +27,6 @@ internal class RoslynTypeResolver public HashSet Aliases { get; } public bool FeatureNullable { get; } public bool VariantsUseProperties { get; } - public bool UseOptionalValue { get; } public NameHelper NameHelper { get; } public Dictionary DeclaredTypes { get; } @@ -36,7 +35,6 @@ public RoslynTypeResolver( HashSet aliases, bool featureNullable, bool variantsUseProperties, - bool useOptionalValue, NameHelper nameHelper, Dictionary declaredTypes ) @@ -45,7 +43,6 @@ public RoslynTypeResolver( this.Aliases = aliases; this.FeatureNullable = featureNullable; this.VariantsUseProperties = variantsUseProperties; - this.UseOptionalValue = useOptionalValue; this.NameHelper = nameHelper; this.DeclaredTypes = declaredTypes; } @@ -131,16 +128,7 @@ private ResolvedType ResolveTypeInner( case OptionalValueSourceCodeType v: { ResolvedType resolvedGenericType = this.ResolveType(v.GenericType, nameContext + "Value", parentType); - TypeName name; - if (!this.UseOptionalValue) - { - // Use '?' vs 'OptionalValue<>' - name = new NullableTypeName(resolvedGenericType.Name); - } - else - { - name = new OptionalValueTypeName(resolvedGenericType.Name); - } + TypeName name = new OptionalValueTypeName(resolvedGenericType.Name); return new ResolvedType(name, resolvedGenericType.GeneratedSyntax); } case ArraySourceCodeType a: @@ -280,20 +268,20 @@ public ClassDeclarationSyntax GenerateClient( { // If there are no types, just create an enum value - TypeName enumTypeName = this.BuildType(variantTypeName.BuildName(this.FeatureNullable, this.UseOptionalValue, false), parentType, isDefaultNullable: false); + TypeName enumTypeName = this.BuildType(variantTypeName.BuildName(this.FeatureNullable, false), parentType, isDefaultNullable: false); EnumDeclarationSyntax enumSyntax = this.GenerateEnum(enumTypeName, enumOptions); return (null, enumSyntax); } else { - TypeName enumTypeName = this.BuildType(variantTypeName.BuildName(this.FeatureNullable, this.UseOptionalValue, false) + "Tag", parentType, isDefaultNullable: false); + TypeName enumTypeName = this.BuildType(variantTypeName.BuildName(this.FeatureNullable, false) + "Tag", parentType, isDefaultNullable: false); // TODO auto change the property values of all class types if it matches the name - bool containsClashingTag = variantTypeName.BuildName(this.FeatureNullable, this.UseOptionalValue, false) == "Tag" + bool containsClashingTag = variantTypeName.BuildName(this.FeatureNullable, false) == "Tag" || variant.Options.Any(o => o.Tag.Name == "Tag"); string tagName = containsClashingTag ? "Tag_" : "Tag"; - bool containsClashingValue = variantTypeName.BuildName(this.FeatureNullable, this.UseOptionalValue, false) == "Value" + bool containsClashingValue = variantTypeName.BuildName(this.FeatureNullable, false) == "Value" || variant.Options.Any(o => o.Tag.Name == "Value"); string valueName = containsClashingValue ? "Value_" : "Value"; @@ -396,13 +384,13 @@ private List GenerateVariantProperties( ), SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - enumTypeName.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + enumTypeName.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.IdentifierName(o.Name.Name) ) ), // ({OptionType}) this.Value! SyntaxFactory.CastExpression( - o.Type!.Name.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + o.Type!.Name.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.PostfixUnaryExpression( SyntaxKind.SuppressNullableWarningExpression, SyntaxFactory.MemberAccessExpression( @@ -456,7 +444,7 @@ private List GenerateVariantProperties( SyntaxFactory.Argument( SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - enumTypeName.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + enumTypeName.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.IdentifierName(o.Name.Name) ) ), @@ -475,7 +463,7 @@ private List GenerateVariantProperties( }; TypeName fixedTypeName = new NullableTypeName(o.Type.Name); return SyntaxFactory.PropertyDeclaration( - fixedTypeName.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + fixedTypeName.ToTypeSyntax(this.FeatureNullable), o.Name.Name ) .WithModifiers( @@ -687,7 +675,7 @@ string valueName SyntaxFactory.Argument( SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - enumType.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + enumType.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.IdentifierName(optionName.Name) ) ) @@ -697,7 +685,7 @@ string valueName ), SyntaxFactory.ReturnStatement( SyntaxFactory.CastExpression( - optionType.Name.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + optionType.Name.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.PostfixUnaryExpression( SyntaxKind.SuppressNullableWarningExpression, SyntaxFactory.MemberAccessExpression( @@ -739,7 +727,7 @@ string optionValueParamName { creationParameters.Add((optionType.Name, optionValueParamName)); } - string methodName = optionTypeName.Name == variantTypeName.BuildName(this.FeatureNullable, this.UseOptionalValue, false) + string methodName = optionTypeName.Name == variantTypeName.BuildName(this.FeatureNullable, false) ? optionTypeName.Name + "_" // Escape colliding names : optionTypeName.Name; return this.GenerateMethod( @@ -747,7 +735,7 @@ string optionValueParamName body: SyntaxFactory.Block( SyntaxFactory.ReturnStatement( SyntaxFactory.ObjectCreationExpression( - variantTypeName.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue) + variantTypeName.ToTypeSyntax(this.FeatureNullable) ) .WithArgumentList( SyntaxFactory.ArgumentList( @@ -756,7 +744,7 @@ string optionValueParamName SyntaxFactory.Argument( SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, - enumTypeName.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + enumTypeName.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.IdentifierName(optionTypeName.Name) ) ), @@ -798,7 +786,7 @@ internal ClassDeclarationSyntax GenerateRecord(TypeName recordTypeName, RecordSo .Select((f, i) => { ResolvedName propertyName = f.Tag; - if (propertyName.Name == recordTypeName.BuildName(this.FeatureNullable, this.UseOptionalValue, false)) + if (propertyName.Name == recordTypeName.BuildName(this.FeatureNullable, false)) { // Cant match the class name propertyName = new ResolvedName( @@ -868,7 +856,7 @@ internal ClassDeclarationSyntax GenerateRecord(TypeName recordTypeName, RecordSo PropertyDeclarationSyntax propertySyntax = SyntaxFactory .PropertyDeclaration( - property.Type.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), + property.Type.ToTypeSyntax(this.FeatureNullable), SyntaxFactory.Identifier(property.Name) ) .WithAccessorList(SyntaxFactory.AccessorList( @@ -930,7 +918,7 @@ private EnumDeclarationSyntax GenerateEnum(TypeName enumName, List<(ResolvedName .Select(i => SyntaxFactory.Token(SyntaxKind.CommaToken)); // public enum {enumName} - return SyntaxFactory.EnumDeclaration(enumName.BuildName(this.FeatureNullable, this.UseOptionalValue, false)) + return SyntaxFactory.EnumDeclaration(enumName.BuildName(this.FeatureNullable, false)) .WithModifiers( // public SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)) @@ -967,14 +955,14 @@ private AttributeListSyntax GenerateAttribute(AttributeInfo attribute) SyntaxKind.NumericLiteralExpression, SyntaxFactory.Literal(t.Id) ), - TypeName type => SyntaxFactory.TypeOfExpression(type.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue)), + TypeName type => SyntaxFactory.TypeOfExpression(type.ToTypeSyntax(this.FeatureNullable)), _ => throw new NotImplementedException() }; }) .Select(a => SyntaxFactory.AttributeArgument(a)) ?? Array.Empty(); - string typeName = attribute.Type.BuildName(this.FeatureNullable, this.UseOptionalValue, true); + string typeName = attribute.Type.BuildName(this.FeatureNullable, true); typeName = typeName[..^"Attribute".Length]; // Remove suffix return SyntaxFactory.AttributeList( SyntaxFactory.SingletonSeparatedList( @@ -1169,7 +1157,7 @@ string candidConverterProperty SyntaxFactory.TypeArgumentList( SyntaxFactory.SeparatedList( returnTypes - .Select(t => t.Type.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue)) + .Select(t => t.Type.ToTypeSyntax(this.FeatureNullable)) ) ) ) @@ -1415,7 +1403,7 @@ private ConstructorDeclarationSyntax GenerateConstructor( ConstructorDeclarationSyntax constructor = SyntaxFactory .ConstructorDeclaration( - SyntaxFactory.Identifier(name.BuildName(this.FeatureNullable, this.UseOptionalValue, false)) + SyntaxFactory.Identifier(name.BuildName(this.FeatureNullable, false)) ) .WithParameterList( SyntaxFactory.ParameterList( @@ -1428,7 +1416,7 @@ private ConstructorDeclarationSyntax GenerateConstructor( return SyntaxFactory.Parameter( SyntaxFactory.Identifier(argName) ) - .WithType(p.Type!.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue)); + .WithType(p.Type!.ToTypeSyntax(this.FeatureNullable)); }) .Concat(optionalProperties .Where(p => p.Type != null) @@ -1438,7 +1426,7 @@ private ConstructorDeclarationSyntax GenerateConstructor( return SyntaxFactory.Parameter( SyntaxFactory.Identifier(argName) ) - .WithType(p.Type!.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue)) + .WithType(p.Type!.ToTypeSyntax(this.FeatureNullable)) // Add `= default` to the end .WithDefault(SyntaxFactory.EqualsValueClause( SyntaxFactory.LiteralExpression( @@ -1492,7 +1480,7 @@ private MethodDeclarationSyntax GenerateMethod( if (returnTypes.Count == 1) { // Single return type - returnType = returnTypes[0].Type.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue); + returnType = returnTypes[0].Type.ToTypeSyntax(this.FeatureNullable); } else { @@ -1500,7 +1488,7 @@ private MethodDeclarationSyntax GenerateMethod( returnType = SyntaxFactory.TupleType(SyntaxFactory.SeparatedList( returnTypes .Where(t => t != null) - .Select(t => SyntaxFactory.TupleElement(t.Type.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue), (" " + t.Value.Name).ToSyntaxIdentifier())) + .Select(t => SyntaxFactory.TupleElement(t.Type.ToTypeSyntax(this.FeatureNullable), (" " + t.Value.Name).ToSyntaxIdentifier())) )); } } @@ -1567,7 +1555,7 @@ private MethodDeclarationSyntax GenerateMethod( { return SyntaxFactory .Parameter(p.Name.ToSyntaxIdentifier()) - .WithType(p.Type.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue)); + .WithType(p.Type.ToTypeSyntax(this.FeatureNullable)); }); return SyntaxFactory.MethodDeclaration(returnType, SyntaxFactory.Identifier(name)) .WithModifiers(SyntaxFactory.TokenList(methodModifiers)) @@ -1639,7 +1627,7 @@ ClassProperty FixDuplicates(ClassProperty property) )); } - ClassDeclarationSyntax classSyntax = SyntaxFactory.ClassDeclaration(name.BuildName(this.FeatureNullable, this.UseOptionalValue, false)) + ClassDeclarationSyntax classSyntax = SyntaxFactory.ClassDeclaration(name.BuildName(this.FeatureNullable, false)) .WithModifiers(SyntaxFactory.TokenList( // Make class public SyntaxFactory.Token(SyntaxKind.PublicKeyword) @@ -1663,7 +1651,7 @@ ClassProperty FixDuplicates(ClassProperty property) SyntaxFactory.BaseList( SyntaxFactory.SeparatedList( implementTypes - .Select(t => SyntaxFactory.SimpleBaseType(t.ToTypeSyntax(this.FeatureNullable, this.UseOptionalValue))) + .Select(t => SyntaxFactory.SimpleBaseType(t.ToTypeSyntax(this.FeatureNullable))) .Cast() .ToArray() ) diff --git a/src/ClientGenerator/TomlConfigParser.cs b/src/ClientGenerator/TomlConfigParser.cs index 5345fd63..e46b6a9f 100644 --- a/src/ClientGenerator/TomlConfigParser.cs +++ b/src/ClientGenerator/TomlConfigParser.cs @@ -65,7 +65,6 @@ public static List Parse(string filePath) featureNullable: clientOptions.FeatureNullable ?? true, variantsUseProperties: clientOptions.VariantsUseProperties ?? false, keepCandidCase: clientOptions.KeepCandidCase ?? false, - useOptionalValue: clientOptions.UseOptionalValue ?? true, boundryNodeUrl: clientOptions.BaseUrl, types: clientOptions.Types ); diff --git a/src/ClientGenerator/TypeName.cs b/src/ClientGenerator/TypeName.cs index 46dc6030..43e73d6a 100644 --- a/src/ClientGenerator/TypeName.cs +++ b/src/ClientGenerator/TypeName.cs @@ -20,22 +20,22 @@ public AliasedTypeName(TypeName aliased, TypeName notAliased) this.Aliased = aliased ?? throw new ArgumentNullException(nameof(aliased)); this.NotAliased = notAliased ?? throw new ArgumentNullException(nameof(notAliased)); } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { if (resolveAliases) { - return this.NotAliased.BuildName(featureNullable, useOptionalValue, includeNamespace, true); + return this.NotAliased.BuildName(featureNullable, includeNamespace, true); } - return this.Aliased.BuildName(featureNullable, useOptionalValue, includeNamespace, false); + return this.Aliased.BuildName(featureNullable, includeNamespace, false); } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { if (resolveAliases) { - return this.NotAliased.ToTypeSyntax(featureNullable, useOptionalValue, false); + return this.NotAliased.ToTypeSyntax(featureNullable, false); } - return this.Aliased.ToTypeSyntax(featureNullable, useOptionalValue, false); + return this.Aliased.ToTypeSyntax(featureNullable, false); } } internal class NestedTypeName : TypeName @@ -49,18 +49,18 @@ public NestedTypeName(TypeName parentType, string name) this.Name = name ?? throw new ArgumentNullException(nameof(name)); } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { if (!includeNamespace) { return this.Name; } - return this.ParentType.BuildName(featureNullable, useOptionalValue, true, resolveAliases) + "." + this.Name; + return this.ParentType.BuildName(featureNullable, true, resolveAliases) + "." + this.Name; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { - string typeName = this.BuildName(featureNullable, useOptionalValue, includeNamespace: true, resolveAliases: resolveAliases); + string typeName = this.BuildName(featureNullable, includeNamespace: true, resolveAliases: resolveAliases); return SyntaxFactory.IdentifierName(typeName); } } @@ -78,7 +78,7 @@ public SimpleTypeName(string name, string? @namespace, bool isDefaultNullable) this.IsDefaultNullable = isDefaultNullable; } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { if (!includeNamespace || this.Namespace == null) { @@ -87,9 +87,9 @@ public override string BuildName(bool featureNullable, bool useOptionalValue, bo return this.Namespace + "." + this.Name; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { - string typeName = this.BuildName(featureNullable, useOptionalValue, includeNamespace: true, resolveAliases: resolveAliases); + string typeName = this.BuildName(featureNullable, includeNamespace: true, resolveAliases: resolveAliases); return SyntaxFactory.IdentifierName(typeName); } @@ -128,7 +128,7 @@ public ListTypeName(TypeName innerType) this.InnerType = innerType; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { return SyntaxFactory.GenericName( SyntaxFactory.Identifier("System.Collections.Generic.List") @@ -136,15 +136,15 @@ public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalVa .WithTypeArgumentList( SyntaxFactory.TypeArgumentList( SyntaxFactory.SingletonSeparatedList( - this.InnerType.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases) + this.InnerType.ToTypeSyntax(featureNullable, resolveAliases) ) ) ); } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { - return $"System.Collections.Generic.List<{this.InnerType.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases)}>"; + return $"System.Collections.Generic.List<{this.InnerType.BuildName(featureNullable, includeNamespace, resolveAliases)}>"; } } @@ -159,7 +159,7 @@ public DictionaryTypeName(TypeName keyType, TypeName valueType) this.ValueType = valueType; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { return SyntaxFactory.GenericName( SyntaxFactory.Identifier("System.Collections.Generic.Dictionary") @@ -168,18 +168,18 @@ public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalVa SyntaxFactory.TypeArgumentList( SyntaxFactory.SeparatedList( new[] { - this.KeyType.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases), - this.ValueType.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases) + this.KeyType.ToTypeSyntax(featureNullable, resolveAliases), + this.ValueType.ToTypeSyntax(featureNullable, resolveAliases) } ) ) ); } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { - string key = this.KeyType.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases); - string value = this.ValueType.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases); + string key = this.KeyType.BuildName(featureNullable, includeNamespace, resolveAliases); + string value = this.ValueType.BuildName(featureNullable, includeNamespace, resolveAliases); return $"System.Collections.Generic.Dictionary<{key}, {value}>"; } } @@ -193,31 +193,23 @@ public OptionalValueTypeName(TypeName innerType) this.InnerType = innerType; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { - if (!useOptionalValue) - { - return new NullableTypeName(this.InnerType).ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases); - } return SyntaxFactory.GenericName( SyntaxFactory.Identifier(typeof(OptionalValue<>).Namespace + ".OptionalValue") ) .WithTypeArgumentList( SyntaxFactory.TypeArgumentList( SyntaxFactory.SingletonSeparatedList( - this.InnerType.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases) + this.InnerType.ToTypeSyntax(featureNullable, resolveAliases) ) ) ); } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { - if (!useOptionalValue) - { - return new NullableTypeName(this.InnerType).BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases); - } - return $"{typeof(OptionalValue<>).Namespace}.OptionalValue<{this.InnerType.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases)}>"; + return $"{typeof(OptionalValue<>).Namespace}.OptionalValue<{this.InnerType.BuildName(featureNullable, includeNamespace, resolveAliases)}>"; } } @@ -238,20 +230,20 @@ public NullableTypeName(TypeName innerType) } } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { - TypeSyntax inner = this.InnerType.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases); + TypeSyntax inner = this.InnerType.ToTypeSyntax(featureNullable, resolveAliases); if (!featureNullable && this.InnerType.IsDefaultNullable) { // Dont wrap in nullable return inner; } - return SyntaxFactory.NullableType(this.InnerType.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases)); + return SyntaxFactory.NullableType(this.InnerType.ToTypeSyntax(featureNullable, resolveAliases)); } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { - string innerName = this.InnerType.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases); + string innerName = this.InnerType.BuildName(featureNullable, includeNamespace, resolveAliases); return featureNullable ? innerName + "?" : innerName; } } @@ -265,9 +257,9 @@ public TupleTypeName(List elementTypeNameList) { this.ElementTypeNameList = elementTypeNameList; } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { - string elements = string.Join(", ", this.ElementTypeNameList.Select(e => e.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases))); + string elements = string.Join(", ", this.ElementTypeNameList.Select(e => e.BuildName(featureNullable, includeNamespace, resolveAliases))); if (resolveAliases) { // Alias statements don't like (..,..) syntax @@ -276,12 +268,12 @@ public override string BuildName(bool featureNullable, bool useOptionalValue, bo return $"({elements})"; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { return SyntaxFactory.TupleType( SyntaxFactory.SeparatedList( this.ElementTypeNameList - .Select(e => SyntaxFactory.TupleElement(e.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases))) + .Select(e => SyntaxFactory.TupleElement(e.ToTypeSyntax(featureNullable, resolveAliases))) ) ); } @@ -297,22 +289,22 @@ public ArrayTypeName(TypeName? elementTypeName) this.ElementTypeName = elementTypeName; } - public override string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases) + public override string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases) { if (this.ElementTypeName == null) { return "System.Array"; } - return this.ElementTypeName.BuildName(featureNullable, useOptionalValue, includeNamespace, resolveAliases) + "[]"; + return this.ElementTypeName.BuildName(featureNullable, includeNamespace, resolveAliases) + "[]"; } - public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases) + public override TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases) { if (this.ElementTypeName == null) { return SyntaxFactory.IdentifierName("System.Array"); } - return SyntaxFactory.ArrayType(this.ElementTypeName.ToTypeSyntax(featureNullable, useOptionalValue, resolveAliases)) + return SyntaxFactory.ArrayType(this.ElementTypeName.ToTypeSyntax(featureNullable, resolveAliases)) .WithRankSpecifiers( SyntaxFactory.SingletonList( SyntaxFactory.ArrayRankSpecifier( @@ -327,13 +319,13 @@ public override TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalVa internal abstract class TypeName { - public abstract string BuildName(bool featureNullable, bool useOptionalValue, bool includeNamespace, bool resolveAliases = false); - public abstract TypeSyntax ToTypeSyntax(bool featureNullable, bool useOptionalValue, bool resolveAliases = false); + public abstract string BuildName(bool featureNullable, bool includeNamespace, bool resolveAliases = false); + public abstract TypeSyntax ToTypeSyntax(bool featureNullable, bool resolveAliases = false); public abstract bool IsDefaultNullable { get; } public override string ToString() { - return this.BuildName(false, true, true, false); + return this.BuildName(false, true, false); } } diff --git a/test/Candid.Tests/Candid.Tests.csproj b/test/Candid.Tests/Candid.Tests.csproj index e2d66344..63c80207 100644 --- a/test/Candid.Tests/Candid.Tests.csproj +++ b/test/Candid.Tests/Candid.Tests.csproj @@ -49,4 +49,8 @@ + + + + diff --git a/test/Candid.Tests/CandidConverterTests.cs b/test/Candid.Tests/CandidConverterTests.cs index bb43d631..4a06112d 100644 --- a/test/Candid.Tests/CandidConverterTests.cs +++ b/test/Candid.Tests/CandidConverterTests.cs @@ -157,48 +157,6 @@ public override int GetHashCode() } } - [Fact] - public void Parital_Record_From_Class() - { - // Deserialize a record with a missing opt field, the value should be a 'NoValue' opt - CandidTag stringFieldName = CandidTag.FromName("StringField"); - CandidTag intFieldName = CandidTag.FromName("IntField"); - - var fieldTypes = new Dictionary - { - {stringFieldName, new CandidOptionalType(new CandidPrimitiveType(PrimitiveType.Text))}, - {intFieldName, new CandidPrimitiveType(PrimitiveType.Int32)} - }; - CandidType type = new CandidRecordType(fieldTypes); - - CandidConverter converter = new CandidConverter( - new CandidConverterOptions - { - UseOptionalValue = false - } - ); - CandidTypedValue typedValue = converter.FromTypedObject(new RecordNullableFieldClass - { - IntField = 1, - StringField = "Test" - }); - CandidRecordType candidType = Assert.IsType(typedValue.Type); - Assert.IsType(candidType.Fields["StringField"]); - - RecordNullableFieldClass obj = converter.ToObject(typedValue.Value); - Assert.NotNull(obj); - Assert.Equal("Test", obj.StringField); - - var fields = new Dictionary - { - {stringFieldName, CandidValue.Null()}, - {intFieldName, CandidValue.Int32(2)} - }; - CandidValue valueWithNull = new CandidRecord(fields); - RecordNullableFieldClass obj2 = converter.ToObject(valueWithNull); - Assert.NotNull(obj2); - Assert.Null(obj2.StringField); - } @@ -334,7 +292,7 @@ public void Optional_Type_Coercion() CandidValue.Text("Text1") ), ["ListOfText"] = new CandidOptional( - new CandidVector(new CandidValue[] + new CandidVector(new CandidValue[] { new CandidOptional(CandidValue.Text("Text2")), new CandidOptional() @@ -350,6 +308,49 @@ public void Optional_Type_Coercion() } + public class OptOverride + { + + [CandidOptional] + public string? OptValue { get; set; } + public OptionalValue OptValue2 { get; set; } = OptionalValue.NoValue(); + } + + [Fact] + public void OptionalValueOverride_Record_WithValue() + { + var raw = new OptOverride { OptValue = "Test1", OptValue2 = OptionalValue.WithValue("Test2") }; + var candidValue = new CandidRecord(new Dictionary + { + ["OptValue"] = new CandidOptional(CandidValue.Text("Test1")), + ["OptValue2"] = new CandidOptional(CandidValue.Text("Test2")), + }); + var candidType = new CandidRecordType(new Dictionary + { + ["OptValue"] = new CandidOptionalType(CandidType.Text()), + ["OptValue2"] = new CandidOptionalType(CandidType.Text()), + }); + var candid = new CandidTypedValue(candidValue, candidType); + this.Test(raw, candid, (a, b) => a.OptValue == b.OptValue && a.OptValue2 == b.OptValue2); + } + [Fact] + public void OptionalValueOverride_Record_Null() + { + var raw = new OptOverride { OptValue = null, OptValue2 = OptionalValue.NoValue() }; + var candidValue = new CandidRecord(new Dictionary + { + ["OptValue"] = new CandidOptional(), + ["OptValue2"] = new CandidOptional(), + }); + var candidType = new CandidRecordType(new Dictionary + { + ["OptValue"] = new CandidOptionalType(CandidType.Text()), + ["OptValue2"] = new CandidOptionalType(CandidType.Text()), + }); + var candid = new CandidTypedValue(candidValue, candidType); + this.Test(raw, candid, (a, b) => a.OptValue == b.OptValue && a.OptValue2 == b.OptValue2); + } + public class OptTypeCoercion { public string? TextValue { get; set; } diff --git a/test/Candid.Tests/Generators/ClientGeneratorTests.cs b/test/Candid.Tests/Generators/ClientGeneratorTests.cs index a76d9c77..6f7dab1f 100644 --- a/test/Candid.Tests/Generators/ClientGeneratorTests.cs +++ b/test/Candid.Tests/Generators/ClientGeneratorTests.cs @@ -28,38 +28,22 @@ public void GenerateClients(string serviceName) string fileText = GetFileText(serviceName + ".did"); string baseNamespace = "Test"; CandidServiceDescription serviceFile = CandidServiceDescription.Parse(fileText); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, true, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, false, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, false, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, true, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, true, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, false, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, true, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, false, false, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, true, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, false, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, false, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, true, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, true, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, false, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, true, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, false, true, true); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, true, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, false, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, false, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, true, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, true, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, false, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, true, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, false, false, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, true, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, false, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, false, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, true, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, true, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, false, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, true, true, false); - this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, false, true, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, true, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, false, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, false, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, true, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, true, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, false, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, true, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, false, false); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, true, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, true, false, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, false, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, true, false, true, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, true, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, true, false, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, true, true); + this.GenerateClientInternal(serviceFile, baseNamespace, serviceName, false, false, false, true); } private void GenerateClientInternal( @@ -69,8 +53,7 @@ private void GenerateClientInternal( bool noFolders, bool featureNullable, bool keepCandidCase, - bool variantsUseProperties, - bool useOptionalValue + bool variantsUseProperties ) { ClientGenerationOptions options = new( @@ -84,7 +67,6 @@ bool useOptionalValue featureNullable: featureNullable, variantsUseProperties: variantsUseProperties, keepCandidCase: keepCandidCase, - useOptionalValue: useOptionalValue, boundryNodeUrl: null, types: null ); @@ -109,7 +91,7 @@ bool useOptionalValue //trees.Add(SyntaxFactory.SyntaxTree(f.Syntax)); } - Snapshot.Match(clientCode, $"{serviceName}_NoFolders_{noFolders}_Nullable_{featureNullable}_KeepCandidCase_{keepCandidCase}_VariantsUseProperties_{variantsUseProperties}_UseOptionalValue_{useOptionalValue}"); + Snapshot.Match(clientCode, $"{serviceName}_NoFolders_{noFolders}_Nullable_{featureNullable}_KeepCandidCase_{keepCandidCase}_VariantsUseProperties_{variantsUseProperties}"); //TODO //CSharpCompilation compilation = CSharpCompilation diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 9b9e2d89..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap deleted file mode 100644 index 9b9e2d89..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 9b9e2d89..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 9b9e2d89..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index c214dad0..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap deleted file mode 100644 index c214dad0..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index c214dad0..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index c214dad0..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index d331df95..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap deleted file mode 100644 index d331df95..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index d331df95..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index d331df95..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> B() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 2fd21dd7..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap deleted file mode 100644 index 2fd21dd7..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 2fd21dd7..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 2fd21dd7..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/AnonymousTuples_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,41 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class AnonymousTuplesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public AnonymousTuplesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task>> a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>>(this.Converter); - } - - public async Task> b() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "b", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index ce8b4ab9..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,512 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 5f14a0f8..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,404 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawErr Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementErr Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositErr Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderErr Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 0f8ddd34..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,501 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 5beb521d..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,393 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawErr Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementErr Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositErr Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderErr Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index bc71dd98..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,512 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order? info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order? AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order?)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index e4890176..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,404 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawErr? Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementErr? Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order? Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order?)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositErr? Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderErr? Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index af8895b3..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,501 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order? info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order? AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order?)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index fc61391b..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,393 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawErr? Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test.Models -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementErr? Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order? Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order?)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test.Models -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test.Models -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositErr? Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test.Models -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using OrderId = System.UInt32; - -namespace Test.Models -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderErr? Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test.Models -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test.Models -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index b505dd4e..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,512 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 21b0ffa8..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,404 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawErr Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementErr Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositErr Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderErr Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index aeca01a5..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,501 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 571f99f1..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,393 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public WithdrawErr Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public OrderPlacementErr Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DepositErr Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public CancelOrderErr Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index a417ab3a..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,512 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order? info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order? AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order?)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index d6e075d4..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,404 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task CancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task Credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task Deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> GetDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> GetOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task GetSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task PlaceOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task Whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task Withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawErr? Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementErr? Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order? Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order?)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - [CandidName("from")] - public Token From { get; set; } - - [CandidName("fromAmount")] - public UnboundedUInt FromAmount { get; set; } - - [CandidName("id")] - public OrderId Id { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("to")] - public Token To { get; set; } - - [CandidName("toAmount")] - public UnboundedUInt ToAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.From = from; - this.FromAmount = fromAmount; - this.Id = id; - this.Owner = owner; - this.To = to; - this.ToAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositErr? Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderErr? Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - [CandidName("amount")] - public UnboundedUInt Amount { get; set; } - - [CandidName("owner")] - public Principal Owner { get; set; } - - [CandidName("token")] - public Token Token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.Amount = amount; - this.Owner = owner; - this.Token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 4c5c9edb..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,501 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - - public static WithdrawReceipt Err(WithdrawErr info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Err, info); - } - - public static WithdrawReceipt Ok(UnboundedUInt info) - { - return new WithdrawReceipt(WithdrawReceiptTag.Ok, info); - } - - public WithdrawErr AsErr() - { - this.ValidateTag(WithdrawReceiptTag.Err); - return (WithdrawErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(WithdrawReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(WithdrawReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - - public static OrderPlacementReceipt Err(OrderPlacementErr info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Err, info); - } - - public static OrderPlacementReceipt Ok(Order? info) - { - return new OrderPlacementReceipt(OrderPlacementReceiptTag.Ok, info); - } - - public OrderPlacementErr AsErr() - { - this.ValidateTag(OrderPlacementReceiptTag.Err); - return (OrderPlacementErr)this.Value!; - } - - public Order? AsOk() - { - this.ValidateTag(OrderPlacementReceiptTag.Ok); - return (Order?)this.Value!; - } - - private void ValidateTag(OrderPlacementReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - - public static DepositReceipt Err(DepositErr info) - { - return new DepositReceipt(DepositReceiptTag.Err, info); - } - - public static DepositReceipt Ok(UnboundedUInt info) - { - return new DepositReceipt(DepositReceiptTag.Ok, info); - } - - public DepositErr AsErr() - { - this.ValidateTag(DepositReceiptTag.Err); - return (DepositErr)this.Value!; - } - - public UnboundedUInt AsOk() - { - this.ValidateTag(DepositReceiptTag.Ok); - return (UnboundedUInt)this.Value!; - } - - private void ValidateTag(DepositReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - - public static CancelOrderReceipt Err(CancelOrderErr info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Err, info); - } - - public static CancelOrderReceipt Ok(OrderId info) - { - return new CancelOrderReceipt(CancelOrderReceiptTag.Ok, info); - } - - public CancelOrderErr AsErr() - { - this.ValidateTag(CancelOrderReceiptTag.Err); - return (CancelOrderErr)this.Value!; - } - - public OrderId AsOk() - { - this.ValidateTag(CancelOrderReceiptTag.Ok); - return (OrderId)this.Value!; - } - - private void ValidateTag(CancelOrderReceiptTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index f0573eab..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Dex_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,393 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class DexApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DexApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task cancelOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "cancelOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task clear() - { - CandidArg arg = CandidArg.FromCandid(); - await this.Agent.CallAsync(this.CanisterId, "clear", arg); - } - - public async Task credit(Principal arg0, Token arg1, UnboundedUInt arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - await this.Agent.CallAsync(this.CanisterId, "credit", arg); - } - - public async Task deposit(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "deposit", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getAllBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getAllBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task getBalance(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalance", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> getBalances() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "getBalances", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task> getDepositAddress() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getDepositAddress", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getOrder(OrderId arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task> getOrders() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getOrders", arg); - return reply.ToObjects>(this.Converter); - } - - public async Task getSymbol(Token arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "getSymbol", arg); - return reply.ToObjects(this.Converter); - } - - public async Task placeOrder(Token arg0, UnboundedUInt arg1, Token arg2, UnboundedUInt arg3) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2), CandidTypedValue.FromObject(arg3)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "placeOrder", arg); - return reply.ToObjects(this.Converter); - } - - public async Task whoami() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "whoami", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task withdraw(Token arg0, UnboundedUInt arg1, Principal arg2) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1), CandidTypedValue.FromObject(arg2)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "withdraw", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'WithdrawReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class WithdrawReceipt - { - [VariantTagProperty()] - public WithdrawReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public WithdrawErr? Err { get => this.Tag == WithdrawReceiptTag.Err ? (WithdrawErr)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == WithdrawReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (WithdrawReceiptTag.Ok, value); } - - public WithdrawReceipt(WithdrawReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected WithdrawReceipt() - { - } - } - - public enum WithdrawReceiptTag - { - Err, - Ok - } -} - -Type File: 'WithdrawErr' - -namespace Test -{ - public enum WithdrawErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'OrderPlacementReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class OrderPlacementReceipt - { - [VariantTagProperty()] - public OrderPlacementReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public OrderPlacementErr? Err { get => this.Tag == OrderPlacementReceiptTag.Err ? (OrderPlacementErr)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Err, value); } - - public Order? Ok { get => this.Tag == OrderPlacementReceiptTag.Ok ? (Order?)this.Value! : default; set => (this.Tag, this.Value) = (OrderPlacementReceiptTag.Ok, value); } - - public OrderPlacementReceipt(OrderPlacementReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected OrderPlacementReceipt() - { - } - } - - public enum OrderPlacementReceiptTag - { - Err, - Ok - } -} - -Type File: 'OrderPlacementErr' - -namespace Test -{ - public enum OrderPlacementErr - { - InvalidOrder, - OrderBookFull - } -} - -Type File: 'Order' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; -using OrderId = System.UInt32; - -namespace Test -{ - public class Order - { - public Token from { get; set; } - - public UnboundedUInt fromAmount { get; set; } - - public OrderId id { get; set; } - - public Principal owner { get; set; } - - public Token to { get; set; } - - public UnboundedUInt toAmount { get; set; } - - public Order(Token from, UnboundedUInt fromAmount, OrderId id, Principal owner, Token to, UnboundedUInt toAmount) - { - this.from = from; - this.fromAmount = fromAmount; - this.id = id; - this.owner = owner; - this.to = to; - this.toAmount = toAmount; - } - - public Order() - { - } - } -} - -Type File: 'DepositReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - [Variant()] - public class DepositReceipt - { - [VariantTagProperty()] - public DepositReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DepositErr? Err { get => this.Tag == DepositReceiptTag.Err ? (DepositErr)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Err, value); } - - public UnboundedUInt? Ok { get => this.Tag == DepositReceiptTag.Ok ? (UnboundedUInt)this.Value! : default; set => (this.Tag, this.Value) = (DepositReceiptTag.Ok, value); } - - public DepositReceipt(DepositReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DepositReceipt() - { - } - } - - public enum DepositReceiptTag - { - Err, - Ok - } -} - -Type File: 'DepositErr' - -namespace Test -{ - public enum DepositErr - { - BalanceLow, - TransferFailure - } -} - -Type File: 'CancelOrderReceipt' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using OrderId = System.UInt32; - -namespace Test -{ - [Variant()] - public class CancelOrderReceipt - { - [VariantTagProperty()] - public CancelOrderReceiptTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public CancelOrderErr? Err { get => this.Tag == CancelOrderReceiptTag.Err ? (CancelOrderErr)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Err, value); } - - public OrderId? Ok { get => this.Tag == CancelOrderReceiptTag.Ok ? (OrderId)this.Value! : default; set => (this.Tag, this.Value) = (CancelOrderReceiptTag.Ok, value); } - - public CancelOrderReceipt(CancelOrderReceiptTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected CancelOrderReceipt() - { - } - } - - public enum CancelOrderReceiptTag - { - Err, - Ok - } -} - -Type File: 'CancelOrderErr' - -namespace Test -{ - public enum CancelOrderErr - { - NotAllowed, - NotExistingOrder - } -} - -Type File: 'Balance' - -using EdjCase.ICP.Candid.Models; -using Token = EdjCase.ICP.Candid.Models.Principal; - -namespace Test -{ - public class Balance - { - public UnboundedUInt amount { get; set; } - - public Principal owner { get; set; } - - public Token token { get; set; } - - public Balance(UnboundedUInt amount, Principal owner, Token token) - { - this.amount = amount; - this.owner = owner; - this.token = token; - } - - public Balance() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 6ada7655..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 6ada7655..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 1312f3a3..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test.Models -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 1312f3a3..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test.Models -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 6015c723..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 6015c723..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 0b6a4542..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test.Models -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 0b6a4542..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test.Models -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 8feb8a4e..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 8feb8a4e..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 4492d533..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 4492d533..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 6f5995fd..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index 6f5995fd..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,59 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task A() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Result - { - [CandidName("a")] - public ulong A { get; set; } - - [CandidName("_a")] - public ulong _A { get; set; } - - public Result(ulong a, ulong _a) - { - this.A = a; - this._A = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index be72442a..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap deleted file mode 100644 index be72442a..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/DuplicatePropertyNames_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap +++ /dev/null @@ -1,55 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class DuplicatePropertyNamesApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task a() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'Result' - -namespace Test -{ - public class Result - { - public ulong a { get; set; } - - public ulong _a { get; set; } - - public Result(ulong a, ulong _a) - { - this.a = a; - this._a = _a; - } - - public Result() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 0b3f80fe..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3688 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal NewHotKey { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change Change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By By { get; set; } - - public ClaimOrRefresh(By by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1 Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1 result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command1(Command1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public static Command1 Error(GovernanceError info) - { - return new Command1(Command1Tag.Error, info); - } - - public static Command1 Spawn(SpawnResponse info) - { - return new Command1(Command1Tag.Spawn, info); - } - - public static Command1 Split(SpawnResponse info) - { - return new Command1(Command1Tag.Split, info); - } - - public static Command1 Follow(Command1.FollowInfo info) - { - return new Command1(Command1Tag.Follow, info); - } - - public static Command1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command1(Command1Tag.ClaimOrRefresh, info); - } - - public static Command1 Configure(Command1.ConfigureInfo info) - { - return new Command1(Command1Tag.Configure, info); - } - - public static Command1 RegisterVote(Command1.RegisterVoteInfo info) - { - return new Command1(Command1Tag.RegisterVote, info); - } - - public static Command1 Merge(Command1.MergeInfo info) - { - return new Command1(Command1Tag.Merge, info); - } - - public static Command1 DisburseToNeuron(SpawnResponse info) - { - return new Command1(Command1Tag.DisburseToNeuron, info); - } - - public static Command1 MakeProposal(MakeProposalResponse info) - { - return new Command1(Command1Tag.MakeProposal, info); - } - - public static Command1 MergeMaturity(MergeMaturityResponse info) - { - return new Command1(Command1Tag.MergeMaturity, info); - } - - public static Command1 Disburse(DisburseResponse info) - { - return new Command1(Command1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command1.FollowInfo AsFollow() - { - this.ValidateTag(Command1Tag.Follow); - return (Command1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command1Tag.Configure); - return (Command1.ConfigureInfo)this.Value!; - } - - public Command1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command1Tag.RegisterVote); - return (Command1.RegisterVoteInfo)this.Value!; - } - - public Command1.MergeInfo AsMerge() - { - this.ValidateTag(Command1Tag.Merge); - return (Command1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command2(Command2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - - public static Command2 Spawn(Spawn info) - { - return new Command2(Command2Tag.Spawn, info); - } - - public static Command2 Split(Split info) - { - return new Command2(Command2Tag.Split, info); - } - - public static Command2 Configure(Configure info) - { - return new Command2(Command2Tag.Configure, info); - } - - public static Command2 Merge(Merge info) - { - return new Command2(Command2Tag.Merge, info); - } - - public static Command2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command2(Command2Tag.DisburseToNeuron, info); - } - - public static Command2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command2(Command2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command2 MergeMaturity(MergeMaturity info) - { - return new Command2(Command2Tag.MergeMaturity, info); - } - - public static Command2 Disburse(Disburse info) - { - return new Command2(Command2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - [CandidName("operation")] - public Operation Operation { get; set; } - - public Configure(Operation operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - [CandidName("amount")] - public Amount Amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string Description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("command")] - public Command Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1 Command { get; set; } - - public ManageNeuronResponse(Command1 command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId SourceNeuronId { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; -using System; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2 Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2 command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - [CandidName("id")] - public Principal Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string Title { get; set; } - - [CandidName("action")] - public Action Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId Proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result1(Result1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - - public static Result1 Error(GovernanceError info) - { - return new Result1(Result1Tag.Error, info); - } - - public static Result1 NeuronId(NeuronId info) - { - return new Result1(Result1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result2(Result2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - - public static Result2 Ok(Neuron info) - { - return new Result2(Result2Tag.Ok, info); - } - - public static Result2 Err(GovernanceError info) - { - return new Result2(Result2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result3(Result3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - - public static Result3 Ok(RewardNodeProviders info) - { - return new Result3(Result3Tag.Ok, info); - } - - public static Result3 Err(GovernanceError info) - { - return new Result3(Result3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result4(Result4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - - public static Result4 Ok(NeuronInfo info) - { - return new Result4(Result4Tag.Ok, info); - } - - public static Result4 Err(GovernanceError info) - { - return new Result4(Result4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result5(Result5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - - public static Result5 Ok(NodeProvider info) - { - return new Result5(Result5Tag.Ok, info); - } - - public static Result5 Err(GovernanceError info) - { - return new Result5(Result5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index a4673a4b..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2909 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public KnownNeuron RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal NewHotKey { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change Change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By.NeuronIdOrSubaccountInfo NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By By { get; set; } - - public ClaimOrRefresh(By by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1 Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1 result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Command1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Error, value); } - - public SpawnResponse Spawn { get => this.Tag == Command1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Spawn, value); } - - public SpawnResponse Split { get => this.Tag == Command1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Split, value); } - - public Command1.FollowInfo Follow { get => this.Tag == Command1Tag.Follow ? (Command1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Follow, value); } - - public ClaimOrRefreshResponse ClaimOrRefresh { get => this.Tag == Command1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.ClaimOrRefresh, value); } - - public Command1.ConfigureInfo Configure { get => this.Tag == Command1Tag.Configure ? (Command1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Configure, value); } - - public Command1.RegisterVoteInfo RegisterVote { get => this.Tag == Command1Tag.RegisterVote ? (Command1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.RegisterVote, value); } - - public Command1.MergeInfo Merge { get => this.Tag == Command1Tag.Merge ? (Command1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Merge, value); } - - public SpawnResponse DisburseToNeuron { get => this.Tag == Command1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse MakeProposal { get => this.Tag == Command1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MakeProposal, value); } - - public MergeMaturityResponse MergeMaturity { get => this.Tag == Command1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MergeMaturity, value); } - - public DisburseResponse Disburse { get => this.Tag == Command1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Disburse, value); } - - public Command1(Command1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == Command2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Spawn, value); } - - public Split Split { get => this.Tag == Command2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Split, value); } - - public Configure Configure { get => this.Tag == Command2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Configure, value); } - - public Merge Merge { get => this.Tag == Command2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == Command2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh ClaimOrRefreshNeuron { get => this.Tag == Command2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == Command2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == Command2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Disburse, value); } - - public Command2(Command2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - [CandidName("operation")] - public Operation Operation { get; set; } - - public Configure(Operation operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - [CandidName("amount")] - public Amount Amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string Description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("command")] - public Command Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1 Command { get; set; } - - public ManageNeuronResponse(Command1 command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId SourceNeuronId { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public List Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2 Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2 command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - [CandidName("id")] - public Principal Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RemoveHotKey RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string Title { get; set; } - - [CandidName("action")] - public Action Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId Proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Result1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.Error, value); } - - public NeuronId NeuronId { get => this.Tag == Result1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.NeuronId, value); } - - public Result1(Result1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Neuron Ok { get => this.Tag == Result2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Err, value); } - - public Result2(Result2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardNodeProviders Ok { get => this.Tag == Result3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Err, value); } - - public Result3(Result3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronInfo Ok { get => this.Tag == Result4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Err, value); } - - public Result4(Result4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider Ok { get => this.Tag == Result5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Err, value); } - - public Result5(Result5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardToNeuron RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index ac6cf6cd..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3418 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - public Principal new_hot_key { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - public Change change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test.Models -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test.Models -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - public By by { get; set; } - - public ClaimOrRefresh(By by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1 result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1 result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - public NeuronId refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command_1(Command_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public static Command_1 Error(GovernanceError info) - { - return new Command_1(Command_1Tag.Error, info); - } - - public static Command_1 Spawn(SpawnResponse info) - { - return new Command_1(Command_1Tag.Spawn, info); - } - - public static Command_1 Split(SpawnResponse info) - { - return new Command_1(Command_1Tag.Split, info); - } - - public static Command_1 Follow(Command_1.FollowInfo info) - { - return new Command_1(Command_1Tag.Follow, info); - } - - public static Command_1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command_1(Command_1Tag.ClaimOrRefresh, info); - } - - public static Command_1 Configure(Command_1.ConfigureInfo info) - { - return new Command_1(Command_1Tag.Configure, info); - } - - public static Command_1 RegisterVote(Command_1.RegisterVoteInfo info) - { - return new Command_1(Command_1Tag.RegisterVote, info); - } - - public static Command_1 Merge(Command_1.MergeInfo info) - { - return new Command_1(Command_1Tag.Merge, info); - } - - public static Command_1 DisburseToNeuron(SpawnResponse info) - { - return new Command_1(Command_1Tag.DisburseToNeuron, info); - } - - public static Command_1 MakeProposal(MakeProposalResponse info) - { - return new Command_1(Command_1Tag.MakeProposal, info); - } - - public static Command_1 MergeMaturity(MergeMaturityResponse info) - { - return new Command_1(Command_1Tag.MergeMaturity, info); - } - - public static Command_1 Disburse(DisburseResponse info) - { - return new Command_1(Command_1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command_1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command_1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command_1.FollowInfo AsFollow() - { - this.ValidateTag(Command_1Tag.Follow); - return (Command_1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command_1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command_1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command_1Tag.Configure); - return (Command_1.ConfigureInfo)this.Value!; - } - - public Command_1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command_1Tag.RegisterVote); - return (Command_1.RegisterVoteInfo)this.Value!; - } - - public Command_1.MergeInfo AsMerge() - { - this.ValidateTag(Command_1Tag.Merge); - return (Command_1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command_1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command_1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command_1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command_1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command_2(Command_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - - public static Command_2 Spawn(Spawn info) - { - return new Command_2(Command_2Tag.Spawn, info); - } - - public static Command_2 Split(Split info) - { - return new Command_2(Command_2Tag.Split, info); - } - - public static Command_2 Configure(Configure info) - { - return new Command_2(Command_2Tag.Configure, info); - } - - public static Command_2 Merge(Merge info) - { - return new Command_2(Command_2Tag.Merge, info); - } - - public static Command_2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command_2(Command_2Tag.DisburseToNeuron, info); - } - - public static Command_2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command_2(Command_2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command_2 MergeMaturity(MergeMaturity info) - { - return new Command_2(Command_2Tag.MergeMaturity, info); - } - - public static Command_2 Disburse(Disburse info) - { - return new Command_2(Command_2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command_2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command_2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command_2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command_2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command_2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command_2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command_2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command_2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - public Operation operation { get; set; } - - public Configure(Operation operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - public AccountIdentifier to_account { get; set; } - - public Amount amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test.Models -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics economics { get; set; } - - public RewardEvent latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test.Models -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - public NeuronId id { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test.Models -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - public NeuronId proposal_id { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - public NeuronId id { get; set; } - - public Command command { get; set; } - - public NeuronIdOrSubaccount neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - public Command_1 command { get; set; } - - public ManageNeuronResponse(Command_1 command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - public NeuronId source_neuron_id { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test.Models -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test.Models -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test.Models -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test.Models -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - public NeuronId id { get; set; } - - public Principal controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer transfer { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test.Models -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; -using System; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - public Command_2 command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2 command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - public Principal id { get; set; } - - public AccountIdentifier reward_account { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - public string url { get; set; } - - public string title { get; set; } - - public Action action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - public NeuronId id { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public WaitForQuietState wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - public NeuronId id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - public Principal hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_1(Result_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - - public static Result_1 Error(GovernanceError info) - { - return new Result_1(Result_1Tag.Error, info); - } - - public static Result_1 NeuronId(NeuronId info) - { - return new Result_1(Result_1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result_1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_2(Result_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - - public static Result_2 Ok(Neuron info) - { - return new Result_2(Result_2Tag.Ok, info); - } - - public static Result_2 Err(GovernanceError info) - { - return new Result_2(Result_2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result_2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_3(Result_3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - - public static Result_3 Ok(RewardNodeProviders info) - { - return new Result_3(Result_3Tag.Ok, info); - } - - public static Result_3 Err(GovernanceError info) - { - return new Result_3(Result_3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result_3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_4(Result_4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - - public static Result_4 Ok(NeuronInfo info) - { - return new Result_4(Result_4Tag.Ok, info); - } - - public static Result_4 Err(GovernanceError info) - { - return new Result_4(Result_4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result_4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_5(Result_5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - - public static Result_5 Ok(NodeProvider info) - { - return new Result_5(Result_5Tag.Ok, info); - } - - public static Result_5 Err(GovernanceError info) - { - return new Result_5(Result_5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result_5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - public NodeProvider node_provider { get; set; } - - public RewardMode reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - public AccountIdentifier to_account { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test.Models -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - public NeuronId created_neuron_id { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test.Models -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test.Models -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - public AccountIdentifier reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test.Models -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index ff6f7613..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2639 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public KnownNeuron RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - public Principal new_hot_key { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - public Change change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test.Models -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test.Models -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By.NeuronIdOrSubaccountInfo NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - public By by { get; set; } - - public ClaimOrRefresh(By by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1 result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1 result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - public NeuronId refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Command_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Error, value); } - - public SpawnResponse Spawn { get => this.Tag == Command_1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Spawn, value); } - - public SpawnResponse Split { get => this.Tag == Command_1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Split, value); } - - public Command_1.FollowInfo Follow { get => this.Tag == Command_1Tag.Follow ? (Command_1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Follow, value); } - - public ClaimOrRefreshResponse ClaimOrRefresh { get => this.Tag == Command_1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.ClaimOrRefresh, value); } - - public Command_1.ConfigureInfo Configure { get => this.Tag == Command_1Tag.Configure ? (Command_1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Configure, value); } - - public Command_1.RegisterVoteInfo RegisterVote { get => this.Tag == Command_1Tag.RegisterVote ? (Command_1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.RegisterVote, value); } - - public Command_1.MergeInfo Merge { get => this.Tag == Command_1Tag.Merge ? (Command_1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Merge, value); } - - public SpawnResponse DisburseToNeuron { get => this.Tag == Command_1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse MakeProposal { get => this.Tag == Command_1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MakeProposal, value); } - - public MergeMaturityResponse MergeMaturity { get => this.Tag == Command_1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MergeMaturity, value); } - - public DisburseResponse Disburse { get => this.Tag == Command_1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Disburse, value); } - - public Command_1(Command_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == Command_2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Spawn, value); } - - public Split Split { get => this.Tag == Command_2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Split, value); } - - public Configure Configure { get => this.Tag == Command_2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Configure, value); } - - public Merge Merge { get => this.Tag == Command_2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == Command_2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh ClaimOrRefreshNeuron { get => this.Tag == Command_2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == Command_2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == Command_2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Disburse, value); } - - public Command_2(Command_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - public Operation operation { get; set; } - - public Configure(Operation operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - public AccountIdentifier to_account { get; set; } - - public Amount amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test.Models -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics economics { get; set; } - - public RewardEvent latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test.Models -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - public NeuronId id { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test.Models -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - public NeuronId proposal_id { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - public NeuronId id { get; set; } - - public Command command { get; set; } - - public NeuronIdOrSubaccount neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - public Command_1 command { get; set; } - - public ManageNeuronResponse(Command_1 command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - public NeuronId source_neuron_id { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test.Models -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test.Models -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test.Models -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test.Models -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - public NeuronId id { get; set; } - - public Principal controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer transfer { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test.Models -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public List Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - public Command_2 command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2 command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - public Principal id { get; set; } - - public AccountIdentifier reward_account { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RemoveHotKey RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - public string url { get; set; } - - public string title { get; set; } - - public Action action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - public NeuronId id { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public WaitForQuietState wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - public NeuronId id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - public Principal hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Result_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.Error, value); } - - public NeuronId NeuronId { get => this.Tag == Result_1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.NeuronId, value); } - - public Result_1(Result_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Neuron Ok { get => this.Tag == Result_2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Err, value); } - - public Result_2(Result_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardNodeProviders Ok { get => this.Tag == Result_3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Err, value); } - - public Result_3(Result_3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronInfo Ok { get => this.Tag == Result_4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Err, value); } - - public Result_4(Result_4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider Ok { get => this.Tag == Result_5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Err, value); } - - public Result_5(Result_5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardToNeuron RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - public NodeProvider node_provider { get; set; } - - public RewardMode reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - public AccountIdentifier to_account { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test.Models -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - public NeuronId created_neuron_id { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test.Models -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test.Models -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - public AccountIdentifier reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test.Models -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 49760dd6..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3688 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal? NewHotKey { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change? Change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By? By { get; set; } - - public ClaimOrRefresh(By? by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1? Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1? result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId? RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command1(Command1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public static Command1 Error(GovernanceError info) - { - return new Command1(Command1Tag.Error, info); - } - - public static Command1 Spawn(SpawnResponse info) - { - return new Command1(Command1Tag.Spawn, info); - } - - public static Command1 Split(SpawnResponse info) - { - return new Command1(Command1Tag.Split, info); - } - - public static Command1 Follow(Command1.FollowInfo info) - { - return new Command1(Command1Tag.Follow, info); - } - - public static Command1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command1(Command1Tag.ClaimOrRefresh, info); - } - - public static Command1 Configure(Command1.ConfigureInfo info) - { - return new Command1(Command1Tag.Configure, info); - } - - public static Command1 RegisterVote(Command1.RegisterVoteInfo info) - { - return new Command1(Command1Tag.RegisterVote, info); - } - - public static Command1 Merge(Command1.MergeInfo info) - { - return new Command1(Command1Tag.Merge, info); - } - - public static Command1 DisburseToNeuron(SpawnResponse info) - { - return new Command1(Command1Tag.DisburseToNeuron, info); - } - - public static Command1 MakeProposal(MakeProposalResponse info) - { - return new Command1(Command1Tag.MakeProposal, info); - } - - public static Command1 MergeMaturity(MergeMaturityResponse info) - { - return new Command1(Command1Tag.MergeMaturity, info); - } - - public static Command1 Disburse(DisburseResponse info) - { - return new Command1(Command1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command1.FollowInfo AsFollow() - { - this.ValidateTag(Command1Tag.Follow); - return (Command1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command1Tag.Configure); - return (Command1.ConfigureInfo)this.Value!; - } - - public Command1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command1Tag.RegisterVote); - return (Command1.RegisterVoteInfo)this.Value!; - } - - public Command1.MergeInfo AsMerge() - { - this.ValidateTag(Command1Tag.Merge); - return (Command1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command2(Command2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - - public static Command2 Spawn(Spawn info) - { - return new Command2(Command2Tag.Spawn, info); - } - - public static Command2 Split(Split info) - { - return new Command2(Command2Tag.Split, info); - } - - public static Command2 Configure(Configure info) - { - return new Command2(Command2Tag.Configure, info); - } - - public static Command2 Merge(Merge info) - { - return new Command2(Command2Tag.Merge, info); - } - - public static Command2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command2(Command2Tag.DisburseToNeuron, info); - } - - public static Command2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command2(Command2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command2 MergeMaturity(MergeMaturity info) - { - return new Command2(Command2Tag.MergeMaturity, info); - } - - public static Command2 Disburse(Disburse info) - { - return new Command2(Command2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - [CandidName("operation")] - public Operation? Operation { get; set; } - - public Configure(Operation? operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - [CandidName("amount")] - public Amount? Amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics? Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics? Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent? LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string? Description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId? BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("command")] - public Command? Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount? NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1? Command { get; set; } - - public ManageNeuronResponse(Command1? command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId? SourceNeuronId { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState? DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer? Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; -using System; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2? Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2? command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal? From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - [CandidName("id")] - public Principal? Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string? Title { get; set; } - - [CandidName("action")] - public Action? Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState? WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId? Proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal? HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result1(Result1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - - public static Result1 Error(GovernanceError info) - { - return new Result1(Result1Tag.Error, info); - } - - public static Result1 NeuronId(NeuronId info) - { - return new Result1(Result1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result2(Result2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - - public static Result2 Ok(Neuron info) - { - return new Result2(Result2Tag.Ok, info); - } - - public static Result2 Err(GovernanceError info) - { - return new Result2(Result2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result3(Result3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - - public static Result3 Ok(RewardNodeProviders info) - { - return new Result3(Result3Tag.Ok, info); - } - - public static Result3 Err(GovernanceError info) - { - return new Result3(Result3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result4(Result4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - - public static Result4 Ok(NeuronInfo info) - { - return new Result4(Result4Tag.Ok, info); - } - - public static Result4 Err(GovernanceError info) - { - return new Result4(Result4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result5(Result5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - - public static Result5 Ok(NodeProvider info) - { - return new Result5(Result5Tag.Ok, info); - } - - public static Result5 Err(GovernanceError info) - { - return new Result5(Result5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider? NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode? RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId? CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index a9fb6f39..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2909 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public KnownNeuron? RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron? ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction? ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider? RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees? SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders? RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics? ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc? ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider? AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion? Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal? NewHotKey { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change? Change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By.NeuronIdOrSubaccountInfo? NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount? MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider? ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By? By { get; set; } - - public ClaimOrRefresh(By? by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1? Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1? result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId? RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split? Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow? Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh? ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure? Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote? RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge? Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal? MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Command1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Error, value); } - - public SpawnResponse? Spawn { get => this.Tag == Command1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Spawn, value); } - - public SpawnResponse? Split { get => this.Tag == Command1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Split, value); } - - public Command1.FollowInfo? Follow { get => this.Tag == Command1Tag.Follow ? (Command1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Follow, value); } - - public ClaimOrRefreshResponse? ClaimOrRefresh { get => this.Tag == Command1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.ClaimOrRefresh, value); } - - public Command1.ConfigureInfo? Configure { get => this.Tag == Command1Tag.Configure ? (Command1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Configure, value); } - - public Command1.RegisterVoteInfo? RegisterVote { get => this.Tag == Command1Tag.RegisterVote ? (Command1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.RegisterVote, value); } - - public Command1.MergeInfo? Merge { get => this.Tag == Command1Tag.Merge ? (Command1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Merge, value); } - - public SpawnResponse? DisburseToNeuron { get => this.Tag == Command1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse? MakeProposal { get => this.Tag == Command1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MakeProposal, value); } - - public MergeMaturityResponse? MergeMaturity { get => this.Tag == Command1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MergeMaturity, value); } - - public DisburseResponse? Disburse { get => this.Tag == Command1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Disburse, value); } - - public Command1(Command1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == Command2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Spawn, value); } - - public Split? Split { get => this.Tag == Command2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Split, value); } - - public Configure? Configure { get => this.Tag == Command2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Configure, value); } - - public Merge? Merge { get => this.Tag == Command2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == Command2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh? ClaimOrRefreshNeuron { get => this.Tag == Command2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == Command2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == Command2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Disburse, value); } - - public Command2(Command2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - [CandidName("operation")] - public Operation? Operation { get; set; } - - public Configure(Operation? operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - [CandidName("amount")] - public Amount? Amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics? Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics? Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent? LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string? Description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId? BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("command")] - public Command? Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount? NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1? Command { get; set; } - - public ManageNeuronResponse(Command1? command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId? SourceNeuronId { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState? DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer? Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public List? Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId? NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2? Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2? command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal? From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - [CandidName("id")] - public Principal? Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RemoveHotKey? RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey? AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo? StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo? StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay? IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo? JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp? SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string? Title { get; set; } - - [CandidName("action")] - public Action? Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState? WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId? Proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal? HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Result1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.Error, value); } - - public NeuronId? NeuronId { get => this.Tag == Result1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.NeuronId, value); } - - public Result1(Result1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Neuron? Ok { get => this.Tag == Result2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Err, value); } - - public Result2(Result2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardNodeProviders? Ok { get => this.Tag == Result3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Err, value); } - - public Result3(Result3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronInfo? Ok { get => this.Tag == Result4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Err, value); } - - public Result4(Result4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? Ok { get => this.Tag == Result5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Err, value); } - - public Result5(Result5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardToNeuron? RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount? RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider? NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode? RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId? CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test.Models -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index b89ee75f..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3418 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - public Principal? new_hot_key { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - public Change? change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test.Models -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test.Models -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId? proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - public By? by { get; set; } - - public ClaimOrRefresh(By? by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal? controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1? result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1? result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - public NeuronId? refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command_1(Command_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public static Command_1 Error(GovernanceError info) - { - return new Command_1(Command_1Tag.Error, info); - } - - public static Command_1 Spawn(SpawnResponse info) - { - return new Command_1(Command_1Tag.Spawn, info); - } - - public static Command_1 Split(SpawnResponse info) - { - return new Command_1(Command_1Tag.Split, info); - } - - public static Command_1 Follow(Command_1.FollowInfo info) - { - return new Command_1(Command_1Tag.Follow, info); - } - - public static Command_1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command_1(Command_1Tag.ClaimOrRefresh, info); - } - - public static Command_1 Configure(Command_1.ConfigureInfo info) - { - return new Command_1(Command_1Tag.Configure, info); - } - - public static Command_1 RegisterVote(Command_1.RegisterVoteInfo info) - { - return new Command_1(Command_1Tag.RegisterVote, info); - } - - public static Command_1 Merge(Command_1.MergeInfo info) - { - return new Command_1(Command_1Tag.Merge, info); - } - - public static Command_1 DisburseToNeuron(SpawnResponse info) - { - return new Command_1(Command_1Tag.DisburseToNeuron, info); - } - - public static Command_1 MakeProposal(MakeProposalResponse info) - { - return new Command_1(Command_1Tag.MakeProposal, info); - } - - public static Command_1 MergeMaturity(MergeMaturityResponse info) - { - return new Command_1(Command_1Tag.MergeMaturity, info); - } - - public static Command_1 Disburse(DisburseResponse info) - { - return new Command_1(Command_1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command_1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command_1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command_1.FollowInfo AsFollow() - { - this.ValidateTag(Command_1Tag.Follow); - return (Command_1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command_1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command_1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command_1Tag.Configure); - return (Command_1.ConfigureInfo)this.Value!; - } - - public Command_1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command_1Tag.RegisterVote); - return (Command_1.RegisterVoteInfo)this.Value!; - } - - public Command_1.MergeInfo AsMerge() - { - this.ValidateTag(Command_1Tag.Merge); - return (Command_1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command_1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command_1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command_1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command_1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command_2(Command_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - - public static Command_2 Spawn(Spawn info) - { - return new Command_2(Command_2Tag.Spawn, info); - } - - public static Command_2 Split(Split info) - { - return new Command_2(Command_2Tag.Split, info); - } - - public static Command_2 Configure(Configure info) - { - return new Command_2(Command_2Tag.Configure, info); - } - - public static Command_2 Merge(Merge info) - { - return new Command_2(Command_2Tag.Merge, info); - } - - public static Command_2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command_2(Command_2Tag.DisburseToNeuron, info); - } - - public static Command_2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command_2(Command_2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command_2 MergeMaturity(MergeMaturity info) - { - return new Command_2(Command_2Tag.MergeMaturity, info); - } - - public static Command_2 Disburse(Disburse info) - { - return new Command_2(Command_2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command_2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command_2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command_2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command_2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command_2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command_2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command_2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command_2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - public Operation? operation { get; set; } - - public Configure(Operation? operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - public AccountIdentifier? to_account { get; set; } - - public Amount? amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test.Models -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal? new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics? metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics? economics { get; set; } - - public RewardEvent? latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test.Models -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - public NeuronId? id { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test.Models -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string? description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId? before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - public NeuronId? proposal_id { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - public NeuronId? id { get; set; } - - public Command? command { get; set; } - - public NeuronIdOrSubaccount? neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - public Command_1? command { get; set; } - - public ManageNeuronResponse(Command_1? command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - public NeuronId? source_neuron_id { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test.Models -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test.Models -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test.Models -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test.Models -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - public NeuronId? id { get; set; } - - public Principal? controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState? dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer? transfer { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test.Models -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; -using System; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - public Command_2? command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2? command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal? from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - public Principal? id { get; set; } - - public AccountIdentifier? reward_account { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - public string url { get; set; } - - public string? title { get; set; } - - public Action? action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - public NeuronId? id { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public WaitForQuietState? wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - public NeuronId? id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId? proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - public Principal? hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_1(Result_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - - public static Result_1 Error(GovernanceError info) - { - return new Result_1(Result_1Tag.Error, info); - } - - public static Result_1 NeuronId(NeuronId info) - { - return new Result_1(Result_1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result_1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_2(Result_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - - public static Result_2 Ok(Neuron info) - { - return new Result_2(Result_2Tag.Ok, info); - } - - public static Result_2 Err(GovernanceError info) - { - return new Result_2(Result_2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result_2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_3(Result_3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - - public static Result_3 Ok(RewardNodeProviders info) - { - return new Result_3(Result_3Tag.Ok, info); - } - - public static Result_3 Err(GovernanceError info) - { - return new Result_3(Result_3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result_3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_4(Result_4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - - public static Result_4 Ok(NeuronInfo info) - { - return new Result_4(Result_4Tag.Ok, info); - } - - public static Result_4 Err(GovernanceError info) - { - return new Result_4(Result_4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result_4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_5(Result_5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - - public static Result_5 Ok(NodeProvider info) - { - return new Result_5(Result_5Tag.Ok, info); - } - - public static Result_5 Err(GovernanceError info) - { - return new Result_5(Result_5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result_5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - public NodeProvider? node_provider { get; set; } - - public RewardMode? reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - public AccountIdentifier? to_account { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test.Models -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal? new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - public NeuronId? created_neuron_id { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test.Models -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test.Models -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - public AccountIdentifier? reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test.Models -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 1365053c..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_False_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2639 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(Models.ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(Models.NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(Models.ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(Models.ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(Models.ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(Models.NeuronId arg0, Models.NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(Models.UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public KnownNeuron? RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron? ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction? ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider? RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees? SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders? RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics? ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc? ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider? AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion? Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class AddHotKey - { - public Principal? new_hot_key { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class AddOrRemoveNodeProvider - { - public Change? change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test.Models -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test.Models -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test.Models; - -namespace Test.Models -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId? proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By.NeuronIdOrSubaccountInfo? NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount? MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider? ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefresh - { - public By? by { get; set; } - - public ClaimOrRefresh(By? by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal? controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1? result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1? result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ClaimOrRefreshResponse - { - public NeuronId? refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split? Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow? Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh? ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure? Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote? RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge? Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal? MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Command_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Error, value); } - - public SpawnResponse? Spawn { get => this.Tag == Command_1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Spawn, value); } - - public SpawnResponse? Split { get => this.Tag == Command_1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Split, value); } - - public Command_1.FollowInfo? Follow { get => this.Tag == Command_1Tag.Follow ? (Command_1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Follow, value); } - - public ClaimOrRefreshResponse? ClaimOrRefresh { get => this.Tag == Command_1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.ClaimOrRefresh, value); } - - public Command_1.ConfigureInfo? Configure { get => this.Tag == Command_1Tag.Configure ? (Command_1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Configure, value); } - - public Command_1.RegisterVoteInfo? RegisterVote { get => this.Tag == Command_1Tag.RegisterVote ? (Command_1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.RegisterVote, value); } - - public Command_1.MergeInfo? Merge { get => this.Tag == Command_1Tag.Merge ? (Command_1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Merge, value); } - - public SpawnResponse? DisburseToNeuron { get => this.Tag == Command_1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse? MakeProposal { get => this.Tag == Command_1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MakeProposal, value); } - - public MergeMaturityResponse? MergeMaturity { get => this.Tag == Command_1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MergeMaturity, value); } - - public DisburseResponse? Disburse { get => this.Tag == Command_1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Disburse, value); } - - public Command_1(Command_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == Command_2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Spawn, value); } - - public Split? Split { get => this.Tag == Command_2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Split, value); } - - public Configure? Configure { get => this.Tag == Command_2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Configure, value); } - - public Merge? Merge { get => this.Tag == Command_2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == Command_2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh? ClaimOrRefreshNeuron { get => this.Tag == Command_2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == Command_2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == Command_2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Disburse, value); } - - public Command_2(Command_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test.Models; - -namespace Test.Models -{ - public class Configure - { - public Operation? operation { get; set; } - - public Configure(Operation? operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test.Models; - -namespace Test.Models -{ - public class Disburse - { - public AccountIdentifier? to_account { get; set; } - - public Amount? amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test.Models -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal? new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics? metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics? economics { get; set; } - - public RewardEvent? latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test.Models -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test.Models -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class KnownNeuron - { - public NeuronId? id { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test.Models -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string? description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test.Models -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId? before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test.Models; - -namespace Test.Models -{ - public class MakeProposalResponse - { - public NeuronId? proposal_id { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuron - { - public NeuronId? id { get; set; } - - public Command? command { get; set; } - - public NeuronIdOrSubaccount? neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test.Models; - -namespace Test.Models -{ - public class ManageNeuronResponse - { - public Command_1? command { get; set; } - - public ManageNeuronResponse(Command_1? command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test.Models; - -namespace Test.Models -{ - public class Merge - { - public NeuronId? source_neuron_id { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test.Models -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test.Models -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test.Models -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test.Models -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test.Models; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class Neuron - { - public NeuronId? id { get; set; } - - public Principal? controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState? dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer? transfer { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test.Models -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public List? Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId? NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test.Models; - -namespace Test.Models -{ - public class NeuronInFlightCommand - { - public Command_2? command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2? command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal? from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test.Models; - -namespace Test.Models -{ - public class NodeProvider - { - public Principal? id { get; set; } - - public AccountIdentifier? reward_account { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RemoveHotKey? RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey? AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo? StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo? StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay? IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo? JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp? SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test.Models; - -namespace Test.Models -{ - public class Proposal - { - public string url { get; set; } - - public string? title { get; set; } - - public Action? action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalData - { - public NeuronId? id { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public WaitForQuietState? wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test.Models; -using System.Collections.Generic; - -namespace Test.Models -{ - public class ProposalInfo - { - public NeuronId? id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test.Models; - -namespace Test.Models -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId? proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class RemoveHotKey - { - public Principal? hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Result_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.Error, value); } - - public NeuronId? NeuronId { get => this.Tag == Result_1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.NeuronId, value); } - - public Result_1(Result_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Neuron? Ok { get => this.Tag == Result_2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Err, value); } - - public Result_2(Result_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardNodeProviders? Ok { get => this.Tag == Result_3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Err, value); } - - public Result_3(Result_3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronInfo? Ok { get => this.Tag == Result_4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Err, value); } - - public Result_4(Result_4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? Ok { get => this.Tag == Result_5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Err, value); } - - public Result_5(Result_5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test.Models; - -namespace Test.Models -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardToNeuron? RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount? RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProvider - { - public NodeProvider? node_provider { get; set; } - - public RewardMode? reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test.Models; - -namespace Test.Models -{ - public class RewardToAccount - { - public AccountIdentifier? to_account { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test.Models -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test.Models; - -namespace Test.Models -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test.Models -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test.Models -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal? new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test.Models; - -namespace Test.Models -{ - public class SpawnResponse - { - public NeuronId? created_neuron_id { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test.Models -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test.Models -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test.Models; - -namespace Test.Models -{ - public class UpdateNodeProvider - { - public AccountIdentifier? reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test.Models -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index bb5abb29..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3688 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal NewHotKey { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change Change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By By { get; set; } - - public ClaimOrRefresh(By by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1 Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1 result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command1(Command1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public static Command1 Error(GovernanceError info) - { - return new Command1(Command1Tag.Error, info); - } - - public static Command1 Spawn(SpawnResponse info) - { - return new Command1(Command1Tag.Spawn, info); - } - - public static Command1 Split(SpawnResponse info) - { - return new Command1(Command1Tag.Split, info); - } - - public static Command1 Follow(Command1.FollowInfo info) - { - return new Command1(Command1Tag.Follow, info); - } - - public static Command1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command1(Command1Tag.ClaimOrRefresh, info); - } - - public static Command1 Configure(Command1.ConfigureInfo info) - { - return new Command1(Command1Tag.Configure, info); - } - - public static Command1 RegisterVote(Command1.RegisterVoteInfo info) - { - return new Command1(Command1Tag.RegisterVote, info); - } - - public static Command1 Merge(Command1.MergeInfo info) - { - return new Command1(Command1Tag.Merge, info); - } - - public static Command1 DisburseToNeuron(SpawnResponse info) - { - return new Command1(Command1Tag.DisburseToNeuron, info); - } - - public static Command1 MakeProposal(MakeProposalResponse info) - { - return new Command1(Command1Tag.MakeProposal, info); - } - - public static Command1 MergeMaturity(MergeMaturityResponse info) - { - return new Command1(Command1Tag.MergeMaturity, info); - } - - public static Command1 Disburse(DisburseResponse info) - { - return new Command1(Command1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command1.FollowInfo AsFollow() - { - this.ValidateTag(Command1Tag.Follow); - return (Command1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command1Tag.Configure); - return (Command1.ConfigureInfo)this.Value!; - } - - public Command1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command1Tag.RegisterVote); - return (Command1.RegisterVoteInfo)this.Value!; - } - - public Command1.MergeInfo AsMerge() - { - this.ValidateTag(Command1Tag.Merge); - return (Command1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command2(Command2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - - public static Command2 Spawn(Spawn info) - { - return new Command2(Command2Tag.Spawn, info); - } - - public static Command2 Split(Split info) - { - return new Command2(Command2Tag.Split, info); - } - - public static Command2 Configure(Configure info) - { - return new Command2(Command2Tag.Configure, info); - } - - public static Command2 Merge(Merge info) - { - return new Command2(Command2Tag.Merge, info); - } - - public static Command2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command2(Command2Tag.DisburseToNeuron, info); - } - - public static Command2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command2(Command2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command2 MergeMaturity(MergeMaturity info) - { - return new Command2(Command2Tag.MergeMaturity, info); - } - - public static Command2 Disburse(Disburse info) - { - return new Command2(Command2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Configure - { - [CandidName("operation")] - public Operation Operation { get; set; } - - public Configure(Operation operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - [CandidName("amount")] - public Amount Amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string Description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("command")] - public Command Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1 Command { get; set; } - - public ManageNeuronResponse(Command1 command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId SourceNeuronId { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; -using System; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2 Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2 command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - [CandidName("id")] - public Principal Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string Title { get; set; } - - [CandidName("action")] - public Action Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId Proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result1(Result1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - - public static Result1 Error(GovernanceError info) - { - return new Result1(Result1Tag.Error, info); - } - - public static Result1 NeuronId(NeuronId info) - { - return new Result1(Result1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result2(Result2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - - public static Result2 Ok(Neuron info) - { - return new Result2(Result2Tag.Ok, info); - } - - public static Result2 Err(GovernanceError info) - { - return new Result2(Result2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result3(Result3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - - public static Result3 Ok(RewardNodeProviders info) - { - return new Result3(Result3Tag.Ok, info); - } - - public static Result3 Err(GovernanceError info) - { - return new Result3(Result3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result4(Result4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - - public static Result4 Ok(NeuronInfo info) - { - return new Result4(Result4Tag.Ok, info); - } - - public static Result4 Err(GovernanceError info) - { - return new Result4(Result4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result5(Result5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - - public static Result5 Ok(NodeProvider info) - { - return new Result5(Result5Tag.Ok, info); - } - - public static Result5 Err(GovernanceError info) - { - return new Result5(Result5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index c704466e..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2909 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public KnownNeuron RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal NewHotKey { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change Change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By.NeuronIdOrSubaccountInfo NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By By { get; set; } - - public ClaimOrRefresh(By by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1 Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1 result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Command1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Error, value); } - - public SpawnResponse Spawn { get => this.Tag == Command1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Spawn, value); } - - public SpawnResponse Split { get => this.Tag == Command1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Split, value); } - - public Command1.FollowInfo Follow { get => this.Tag == Command1Tag.Follow ? (Command1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Follow, value); } - - public ClaimOrRefreshResponse ClaimOrRefresh { get => this.Tag == Command1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.ClaimOrRefresh, value); } - - public Command1.ConfigureInfo Configure { get => this.Tag == Command1Tag.Configure ? (Command1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Configure, value); } - - public Command1.RegisterVoteInfo RegisterVote { get => this.Tag == Command1Tag.RegisterVote ? (Command1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.RegisterVote, value); } - - public Command1.MergeInfo Merge { get => this.Tag == Command1Tag.Merge ? (Command1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Merge, value); } - - public SpawnResponse DisburseToNeuron { get => this.Tag == Command1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse MakeProposal { get => this.Tag == Command1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MakeProposal, value); } - - public MergeMaturityResponse MergeMaturity { get => this.Tag == Command1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MergeMaturity, value); } - - public DisburseResponse Disburse { get => this.Tag == Command1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Disburse, value); } - - public Command1(Command1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == Command2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Spawn, value); } - - public Split Split { get => this.Tag == Command2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Split, value); } - - public Configure Configure { get => this.Tag == Command2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Configure, value); } - - public Merge Merge { get => this.Tag == Command2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == Command2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh ClaimOrRefreshNeuron { get => this.Tag == Command2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == Command2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == Command2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Disburse, value); } - - public Command2(Command2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Configure - { - [CandidName("operation")] - public Operation Operation { get; set; } - - public Configure(Operation operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - [CandidName("amount")] - public Amount Amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string Description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId ProposalId { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("command")] - public Command Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1 Command { get; set; } - - public ManageNeuronResponse(Command1 command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId SourceNeuronId { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("controller")] - public Principal Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public List Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2 Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2 command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - [CandidName("id")] - public Principal Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RemoveHotKey RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string Title { get; set; } - - [CandidName("action")] - public Action Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId Proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Result1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.Error, value); } - - public NeuronId NeuronId { get => this.Tag == Result1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.NeuronId, value); } - - public Result1(Result1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Neuron Ok { get => this.Tag == Result2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Err, value); } - - public Result2(Result2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardNodeProviders Ok { get => this.Tag == Result3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Err, value); } - - public Result3(Result3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronInfo Ok { get => this.Tag == Result4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Err, value); } - - public Result4(Result4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider Ok { get => this.Tag == Result5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Err, value); } - - public Result5(Result5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardToNeuron RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 91edfb02..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3418 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - public Principal new_hot_key { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - public Change change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test; - -namespace Test -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - public By by { get; set; } - - public ClaimOrRefresh(By by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1 result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1 result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - public NeuronId refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command_1(Command_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public static Command_1 Error(GovernanceError info) - { - return new Command_1(Command_1Tag.Error, info); - } - - public static Command_1 Spawn(SpawnResponse info) - { - return new Command_1(Command_1Tag.Spawn, info); - } - - public static Command_1 Split(SpawnResponse info) - { - return new Command_1(Command_1Tag.Split, info); - } - - public static Command_1 Follow(Command_1.FollowInfo info) - { - return new Command_1(Command_1Tag.Follow, info); - } - - public static Command_1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command_1(Command_1Tag.ClaimOrRefresh, info); - } - - public static Command_1 Configure(Command_1.ConfigureInfo info) - { - return new Command_1(Command_1Tag.Configure, info); - } - - public static Command_1 RegisterVote(Command_1.RegisterVoteInfo info) - { - return new Command_1(Command_1Tag.RegisterVote, info); - } - - public static Command_1 Merge(Command_1.MergeInfo info) - { - return new Command_1(Command_1Tag.Merge, info); - } - - public static Command_1 DisburseToNeuron(SpawnResponse info) - { - return new Command_1(Command_1Tag.DisburseToNeuron, info); - } - - public static Command_1 MakeProposal(MakeProposalResponse info) - { - return new Command_1(Command_1Tag.MakeProposal, info); - } - - public static Command_1 MergeMaturity(MergeMaturityResponse info) - { - return new Command_1(Command_1Tag.MergeMaturity, info); - } - - public static Command_1 Disburse(DisburseResponse info) - { - return new Command_1(Command_1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command_1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command_1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command_1.FollowInfo AsFollow() - { - this.ValidateTag(Command_1Tag.Follow); - return (Command_1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command_1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command_1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command_1Tag.Configure); - return (Command_1.ConfigureInfo)this.Value!; - } - - public Command_1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command_1Tag.RegisterVote); - return (Command_1.RegisterVoteInfo)this.Value!; - } - - public Command_1.MergeInfo AsMerge() - { - this.ValidateTag(Command_1Tag.Merge); - return (Command_1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command_1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command_1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command_1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command_1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Command_2(Command_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - - public static Command_2 Spawn(Spawn info) - { - return new Command_2(Command_2Tag.Spawn, info); - } - - public static Command_2 Split(Split info) - { - return new Command_2(Command_2Tag.Split, info); - } - - public static Command_2 Configure(Configure info) - { - return new Command_2(Command_2Tag.Configure, info); - } - - public static Command_2 Merge(Merge info) - { - return new Command_2(Command_2Tag.Merge, info); - } - - public static Command_2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command_2(Command_2Tag.DisburseToNeuron, info); - } - - public static Command_2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command_2(Command_2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command_2 MergeMaturity(MergeMaturity info) - { - return new Command_2(Command_2Tag.MergeMaturity, info); - } - - public static Command_2 Disburse(Disburse info) - { - return new Command_2(Command_2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command_2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command_2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command_2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command_2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command_2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command_2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command_2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command_2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test; - -namespace Test -{ - public class Configure - { - public Operation operation { get; set; } - - public Configure(Operation operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test; - -namespace Test -{ - public class Disburse - { - public AccountIdentifier to_account { get; set; } - - public Amount amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics economics { get; set; } - - public RewardEvent latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test; - -namespace Test -{ - public class KnownNeuron - { - public NeuronId id { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - public NeuronId proposal_id { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test; - -namespace Test -{ - public class ManageNeuron - { - public NeuronId id { get; set; } - - public Command command { get; set; } - - public NeuronIdOrSubaccount neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - public Command_1 command { get; set; } - - public ManageNeuronResponse(Command_1 command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test; - -namespace Test -{ - public class Merge - { - public NeuronId source_neuron_id { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - public NeuronId id { get; set; } - - public Principal controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer transfer { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; -using System; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - public Command_2 command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2 command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - public Principal id { get; set; } - - public AccountIdentifier reward_account { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test; - -namespace Test -{ - public class Proposal - { - public string url { get; set; } - - public string title { get; set; } - - public Action action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - public NeuronId id { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public WaitForQuietState wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - public NeuronId id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test; - -namespace Test -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - public Principal hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_1(Result_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - - public static Result_1 Error(GovernanceError info) - { - return new Result_1(Result_1Tag.Error, info); - } - - public static Result_1 NeuronId(NeuronId info) - { - return new Result_1(Result_1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result_1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_2(Result_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - - public static Result_2 Ok(Neuron info) - { - return new Result_2(Result_2Tag.Ok, info); - } - - public static Result_2 Err(GovernanceError info) - { - return new Result_2(Result_2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result_2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_3(Result_3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - - public static Result_3 Ok(RewardNodeProviders info) - { - return new Result_3(Result_3Tag.Ok, info); - } - - public static Result_3 Err(GovernanceError info) - { - return new Result_3(Result_3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result_3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_4(Result_4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - - public static Result_4 Ok(NeuronInfo info) - { - return new Result_4(Result_4Tag.Ok, info); - } - - public static Result_4 Err(GovernanceError info) - { - return new Result_4(Result_4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result_4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Result_5(Result_5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - - public static Result_5 Ok(NodeProvider info) - { - return new Result_5(Result_5Tag.Ok, info); - } - - public static Result_5 Err(GovernanceError info) - { - return new Result_5(Result_5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result_5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - public NodeProvider node_provider { get; set; } - - public RewardMode reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test; - -namespace Test -{ - public class RewardToAccount - { - public AccountIdentifier to_account { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test; - -namespace Test -{ - public class SpawnResponse - { - public NeuronId created_neuron_id { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - public AccountIdentifier reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 6b904c50..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_False_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2639 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public KnownNeuron RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - public Principal new_hot_key { get; set; } - - public AddHotKey(Principal newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - public Change change { get; set; } - - public AddOrRemoveNodeProvider(Change change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test; - -namespace Test -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public By.NeuronIdOrSubaccountInfo NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - public By by { get; set; } - - public ClaimOrRefresh(By by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1 result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1 result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - public NeuronId refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Command_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Error, value); } - - public SpawnResponse Spawn { get => this.Tag == Command_1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Spawn, value); } - - public SpawnResponse Split { get => this.Tag == Command_1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Split, value); } - - public Command_1.FollowInfo Follow { get => this.Tag == Command_1Tag.Follow ? (Command_1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Follow, value); } - - public ClaimOrRefreshResponse ClaimOrRefresh { get => this.Tag == Command_1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.ClaimOrRefresh, value); } - - public Command_1.ConfigureInfo Configure { get => this.Tag == Command_1Tag.Configure ? (Command_1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Configure, value); } - - public Command_1.RegisterVoteInfo RegisterVote { get => this.Tag == Command_1Tag.RegisterVote ? (Command_1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.RegisterVote, value); } - - public Command_1.MergeInfo Merge { get => this.Tag == Command_1Tag.Merge ? (Command_1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Merge, value); } - - public SpawnResponse DisburseToNeuron { get => this.Tag == Command_1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse MakeProposal { get => this.Tag == Command_1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MakeProposal, value); } - - public MergeMaturityResponse MergeMaturity { get => this.Tag == Command_1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MergeMaturity, value); } - - public DisburseResponse Disburse { get => this.Tag == Command_1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Disburse, value); } - - public Command_1(Command_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Spawn Spawn { get => this.Tag == Command_2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Spawn, value); } - - public Split Split { get => this.Tag == Command_2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Split, value); } - - public Configure Configure { get => this.Tag == Command_2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Configure, value); } - - public Merge Merge { get => this.Tag == Command_2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Merge, value); } - - public DisburseToNeuron DisburseToNeuron { get => this.Tag == Command_2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh ClaimOrRefreshNeuron { get => this.Tag == Command_2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity MergeMaturity { get => this.Tag == Command_2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.MergeMaturity, value); } - - public Disburse Disburse { get => this.Tag == Command_2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Disburse, value); } - - public Command_2(Command_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test; - -namespace Test -{ - public class Configure - { - public Operation operation { get; set; } - - public Configure(Operation operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test; - -namespace Test -{ - public class Disburse - { - public AccountIdentifier to_account { get; set; } - - public Amount amount { get; set; } - - public Disburse(AccountIdentifier toAccount, Amount amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics economics { get; set; } - - public RewardEvent latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics metrics, List nodeProviders, NetworkEconomics economics, RewardEvent latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test; - -namespace Test -{ - public class KnownNeuron - { - public NeuronId id { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public KnownNeuron(NeuronId id, KnownNeuronData knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string description { get; set; } - - public KnownNeuronData(string name, string description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - public NeuronId proposal_id { get; set; } - - public MakeProposalResponse(NeuronId proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test; - -namespace Test -{ - public class ManageNeuron - { - public NeuronId id { get; set; } - - public Command command { get; set; } - - public NeuronIdOrSubaccount neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId id, Command command, NeuronIdOrSubaccount neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - public Command_1 command { get; set; } - - public ManageNeuronResponse(Command_1 command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test; - -namespace Test -{ - public class Merge - { - public NeuronId source_neuron_id { get; set; } - - public Merge(NeuronId sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - public NeuronId id { get; set; } - - public Principal controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer transfer { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public Neuron(NeuronId id, Principal controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer transfer, KnownNeuronData knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public List Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - public Command_2 command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2 command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - public Principal id { get; set; } - - public AccountIdentifier reward_account { get; set; } - - public NodeProvider(Principal id, AccountIdentifier rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RemoveHotKey RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test; - -namespace Test -{ - public class Proposal - { - public string url { get; set; } - - public string title { get; set; } - - public Action action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string title, Action action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - public NeuronId id { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public WaitForQuietState wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId id, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, WaitForQuietState waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - public NeuronId id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal proposal { get; set; } - - public NeuronId proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId id, int status, int topic, GovernanceError failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal proposal, NeuronId proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test; - -namespace Test -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId proposal { get; set; } - - public RegisterVote(int vote, NeuronId proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - public Principal hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public GovernanceError Error { get => this.Tag == Result_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.Error, value); } - - public NeuronId NeuronId { get => this.Tag == Result_1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.NeuronId, value); } - - public Result_1(Result_1Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public Neuron Ok { get => this.Tag == Result_2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Err, value); } - - public Result_2(Result_2Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardNodeProviders Ok { get => this.Tag == Result_3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Err, value); } - - public Result_3(Result_3Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NeuronInfo Ok { get => this.Tag == Result_4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Err, value); } - - public Result_4(Result_4Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public NodeProvider Ok { get => this.Tag == Result_5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Ok, value); } - - public GovernanceError Err { get => this.Tag == Result_5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Err, value); } - - public Result_5(Result_5Tag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object Value { get; set; } - - public RewardToNeuron RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - public NodeProvider node_provider { get; set; } - - public RewardMode reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider nodeProvider, RewardMode rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test; - -namespace Test -{ - public class RewardToAccount - { - public AccountIdentifier to_account { get; set; } - - public RewardToAccount(AccountIdentifier toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test; - -namespace Test -{ - public class SpawnResponse - { - public NeuronId created_neuron_id { get; set; } - - public SpawnResponse(NeuronId createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - public AccountIdentifier reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 743c14ee..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3688 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal? NewHotKey { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change? Change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By? By { get; set; } - - public ClaimOrRefresh(By? by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1? Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1? result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId? RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command1(Command1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public static Command1 Error(GovernanceError info) - { - return new Command1(Command1Tag.Error, info); - } - - public static Command1 Spawn(SpawnResponse info) - { - return new Command1(Command1Tag.Spawn, info); - } - - public static Command1 Split(SpawnResponse info) - { - return new Command1(Command1Tag.Split, info); - } - - public static Command1 Follow(Command1.FollowInfo info) - { - return new Command1(Command1Tag.Follow, info); - } - - public static Command1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command1(Command1Tag.ClaimOrRefresh, info); - } - - public static Command1 Configure(Command1.ConfigureInfo info) - { - return new Command1(Command1Tag.Configure, info); - } - - public static Command1 RegisterVote(Command1.RegisterVoteInfo info) - { - return new Command1(Command1Tag.RegisterVote, info); - } - - public static Command1 Merge(Command1.MergeInfo info) - { - return new Command1(Command1Tag.Merge, info); - } - - public static Command1 DisburseToNeuron(SpawnResponse info) - { - return new Command1(Command1Tag.DisburseToNeuron, info); - } - - public static Command1 MakeProposal(MakeProposalResponse info) - { - return new Command1(Command1Tag.MakeProposal, info); - } - - public static Command1 MergeMaturity(MergeMaturityResponse info) - { - return new Command1(Command1Tag.MergeMaturity, info); - } - - public static Command1 Disburse(DisburseResponse info) - { - return new Command1(Command1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command1.FollowInfo AsFollow() - { - this.ValidateTag(Command1Tag.Follow); - return (Command1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command1Tag.Configure); - return (Command1.ConfigureInfo)this.Value!; - } - - public Command1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command1Tag.RegisterVote); - return (Command1.RegisterVoteInfo)this.Value!; - } - - public Command1.MergeInfo AsMerge() - { - this.ValidateTag(Command1Tag.Merge); - return (Command1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command2(Command2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - - public static Command2 Spawn(Spawn info) - { - return new Command2(Command2Tag.Spawn, info); - } - - public static Command2 Split(Split info) - { - return new Command2(Command2Tag.Split, info); - } - - public static Command2 Configure(Configure info) - { - return new Command2(Command2Tag.Configure, info); - } - - public static Command2 Merge(Merge info) - { - return new Command2(Command2Tag.Merge, info); - } - - public static Command2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command2(Command2Tag.DisburseToNeuron, info); - } - - public static Command2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command2(Command2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command2 MergeMaturity(MergeMaturity info) - { - return new Command2(Command2Tag.MergeMaturity, info); - } - - public static Command2 Disburse(Disburse info) - { - return new Command2(Command2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Configure - { - [CandidName("operation")] - public Operation? Operation { get; set; } - - public Configure(Operation? operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - [CandidName("amount")] - public Amount? Amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics? Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics? Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent? LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string? Description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId? BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("command")] - public Command? Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount? NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1? Command { get; set; } - - public ManageNeuronResponse(Command1? command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId? SourceNeuronId { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState? DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer? Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; -using System; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2? Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2? command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal? From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - [CandidName("id")] - public Principal? Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string? Title { get; set; } - - [CandidName("action")] - public Action? Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState? WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId? Proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal? HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result1(Result1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - - public static Result1 Error(GovernanceError info) - { - return new Result1(Result1Tag.Error, info); - } - - public static Result1 NeuronId(NeuronId info) - { - return new Result1(Result1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result2(Result2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - - public static Result2 Ok(Neuron info) - { - return new Result2(Result2Tag.Ok, info); - } - - public static Result2 Err(GovernanceError info) - { - return new Result2(Result2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result3(Result3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - - public static Result3 Ok(RewardNodeProviders info) - { - return new Result3(Result3Tag.Ok, info); - } - - public static Result3 Err(GovernanceError info) - { - return new Result3(Result3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result4(Result4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - - public static Result4 Ok(NeuronInfo info) - { - return new Result4(Result4Tag.Ok, info); - } - - public static Result4 Err(GovernanceError info) - { - return new Result4(Result4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result5(Result5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - - public static Result5 Ok(NodeProvider info) - { - return new Result5(Result5Tag.Ok, info); - } - - public static Result5 Err(GovernanceError info) - { - return new Result5(Result5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider? NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode? RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId? CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index d3c3f11d..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_False_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2909 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task ClaimGtcNeurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task ClaimOrRefreshNeuronFromAccount(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetBuildMetadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetFullNeuronByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetMonthlyNodeProviderRewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task GetNetworkEconomicsParameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetNeuronIds() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetNeuronInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNeuronInfoByIdOrSubaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task GetNodeProviderByCaller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> GetPendingProposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task GetProposalInfo(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListKnownNeurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNeurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListNodeProviders() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ListProposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task ManageNeuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task TransferGtcNeuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task UpdateNodeProvider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - [CandidName("hash")] - public List Hash { get; set; } - - public AccountIdentifier(List hash) - { - this.Hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public KnownNeuron? RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron? ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction? ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider? RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees? SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders? RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics? ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc? ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider? AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion? Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - [CandidName("new_hot_key")] - public Principal? NewHotKey { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.NewHotKey = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - [CandidName("change")] - public Change? Change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.Change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Amount - { - [CandidName("e8s")] - public ulong E8s { get; set; } - - public Amount(ulong e8s) - { - this.E8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - [CandidName("principals")] - public List Principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.Principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Ballot - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.Vote = vote; - this.VotingPower = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class BallotInfo - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.Vote = vote; - this.ProposalId = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By.NeuronIdOrSubaccountInfo? NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount? MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider? ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - [CandidName("by")] - public By? By { get; set; } - - public ClaimOrRefresh(By? by) - { - this.By = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.Controller = controller; - this.Memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - [CandidName("result")] - public Result1? Result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result1? result) - { - this.Result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - [CandidName("refreshed_neuron_id")] - public NeuronId? RefreshedNeuronId { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.RefreshedNeuronId = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split? Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow? Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh? ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure? Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote? RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge? Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal? MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command1 - { - [VariantTagProperty()] - public Command1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Command1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Error, value); } - - public SpawnResponse? Spawn { get => this.Tag == Command1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Spawn, value); } - - public SpawnResponse? Split { get => this.Tag == Command1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Split, value); } - - public Command1.FollowInfo? Follow { get => this.Tag == Command1Tag.Follow ? (Command1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Follow, value); } - - public ClaimOrRefreshResponse? ClaimOrRefresh { get => this.Tag == Command1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.ClaimOrRefresh, value); } - - public Command1.ConfigureInfo? Configure { get => this.Tag == Command1Tag.Configure ? (Command1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Configure, value); } - - public Command1.RegisterVoteInfo? RegisterVote { get => this.Tag == Command1Tag.RegisterVote ? (Command1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.RegisterVote, value); } - - public Command1.MergeInfo? Merge { get => this.Tag == Command1Tag.Merge ? (Command1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Merge, value); } - - public SpawnResponse? DisburseToNeuron { get => this.Tag == Command1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse? MakeProposal { get => this.Tag == Command1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MakeProposal, value); } - - public MergeMaturityResponse? MergeMaturity { get => this.Tag == Command1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.MergeMaturity, value); } - - public DisburseResponse? Disburse { get => this.Tag == Command1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command1Tag.Disburse, value); } - - public Command1(Command1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command2 - { - [VariantTagProperty()] - public Command2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == Command2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Spawn, value); } - - public Split? Split { get => this.Tag == Command2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Split, value); } - - public Configure? Configure { get => this.Tag == Command2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Configure, value); } - - public Merge? Merge { get => this.Tag == Command2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == Command2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh? ClaimOrRefreshNeuron { get => this.Tag == Command2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == Command2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == Command2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command2Tag.Disburse, value); } - - public Command2(Command2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command2() - { - } - } - - public enum Command2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Configure - { - [CandidName("operation")] - public Operation? Operation { get; set; } - - public Configure(Operation? operation) - { - this.Operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Disburse - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - [CandidName("amount")] - public Amount? Amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.ToAccount = toAccount; - this.Amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class DisburseResponse - { - [CandidName("transfer_block_height")] - public ulong TransferBlockHeight { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.TransferBlockHeight = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong Nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.KycVerified = kycVerified; - this.AmountE8s = amountE8s; - this.NewController = newController; - this.Nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - [CandidName("nns_function")] - public int NnsFunction { get; set; } - - [CandidName("payload")] - public List Payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.NnsFunction = nnsFunction; - this.Payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("followees")] - public List Followees { get; set; } - - public Follow(int topic, List followees) - { - this.Topic = topic; - this.Followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - [CandidName("followees")] - public List Followees_ { get; set; } - - public Followees(List followees) - { - this.Followees_ = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - [CandidName("wait_for_quiet_threshold_seconds")] - public ulong WaitForQuietThresholdSeconds { get; set; } - - [CandidName("metrics")] - public GovernanceCachedMetrics? Metrics { get; set; } - - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - [CandidName("economics")] - public NetworkEconomics? Economics { get; set; } - - [CandidName("latest_reward_event")] - public RewardEvent? LatestRewardEvent { get; set; } - - [CandidName("to_claim_transfers")] - public List ToClaimTransfers { get; set; } - - [CandidName("short_voting_period_seconds")] - public ulong ShortVotingPeriodSeconds { get; set; } - - [CandidName("proposals")] - public Dictionary Proposals { get; set; } - - [CandidName("in_flight_commands")] - public Dictionary InFlightCommands { get; set; } - - [CandidName("neurons")] - public Dictionary Neurons { get; set; } - - [CandidName("genesis_timestamp_seconds")] - public ulong GenesisTimestampSeconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.DefaultFollowees = defaultFollowees; - this.WaitForQuietThresholdSeconds = waitForQuietThresholdSeconds; - this.Metrics = metrics; - this.NodeProviders = nodeProviders; - this.Economics = economics; - this.LatestRewardEvent = latestRewardEvent; - this.ToClaimTransfers = toClaimTransfers; - this.ShortVotingPeriodSeconds = shortVotingPeriodSeconds; - this.Proposals = proposals; - this.InFlightCommands = inFlightCommands; - this.Neurons = neurons; - this.GenesisTimestampSeconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - [CandidName("not_dissolving_neurons_e8s_buckets")] - public Dictionary NotDissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("garbage_collectable_neurons_count")] - public ulong GarbageCollectableNeuronsCount { get; set; } - - [CandidName("neurons_with_invalid_stake_count")] - public ulong NeuronsWithInvalidStakeCount { get; set; } - - [CandidName("not_dissolving_neurons_count_buckets")] - public Dictionary NotDissolvingNeuronsCountBuckets { get; set; } - - [CandidName("total_supply_icp")] - public ulong TotalSupplyIcp { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_count")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayCount { get; set; } - - [CandidName("dissolved_neurons_count")] - public ulong DissolvedNeuronsCount { get; set; } - - [CandidName("total_staked_e8s")] - public ulong TotalStakedE8s { get; set; } - - [CandidName("not_dissolving_neurons_count")] - public ulong NotDissolvingNeuronsCount { get; set; } - - [CandidName("dissolved_neurons_e8s")] - public ulong DissolvedNeuronsE8s { get; set; } - - [CandidName("neurons_with_less_than_6_months_dissolve_delay_e8s")] - public ulong NeuronsWithLessThan6MonthsDissolveDelayE8s { get; set; } - - [CandidName("dissolving_neurons_count_buckets")] - public Dictionary DissolvingNeuronsCountBuckets { get; set; } - - [CandidName("dissolving_neurons_count")] - public ulong DissolvingNeuronsCount { get; set; } - - [CandidName("dissolving_neurons_e8s_buckets")] - public Dictionary DissolvingNeuronsE8sBuckets { get; set; } - - [CandidName("community_fund_total_staked_e8s")] - public ulong CommunityFundTotalStakedE8s { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.NotDissolvingNeuronsE8sBuckets = notDissolvingNeuronsE8sBuckets; - this.GarbageCollectableNeuronsCount = garbageCollectableNeuronsCount; - this.NeuronsWithInvalidStakeCount = neuronsWithInvalidStakeCount; - this.NotDissolvingNeuronsCountBuckets = notDissolvingNeuronsCountBuckets; - this.TotalSupplyIcp = totalSupplyIcp; - this.NeuronsWithLessThan6MonthsDissolveDelayCount = neuronsWithLessThan6MonthsDissolveDelayCount; - this.DissolvedNeuronsCount = dissolvedNeuronsCount; - this.TotalStakedE8s = totalStakedE8s; - this.NotDissolvingNeuronsCount = notDissolvingNeuronsCount; - this.DissolvedNeuronsE8s = dissolvedNeuronsE8s; - this.NeuronsWithLessThan6MonthsDissolveDelayE8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.DissolvingNeuronsCountBuckets = dissolvingNeuronsCountBuckets; - this.DissolvingNeuronsCount = dissolvingNeuronsCount; - this.DissolvingNeuronsE8sBuckets = dissolvingNeuronsE8sBuckets; - this.CommunityFundTotalStakedE8s = communityFundTotalStakedE8s; - this.TimestampSeconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class GovernanceError - { - [CandidName("error_message")] - public string ErrorMessage { get; set; } - - [CandidName("error_type")] - public int ErrorType { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.ErrorMessage = errorMessage; - this.ErrorType = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class IncreaseDissolveDelay - { - [CandidName("additional_dissolve_delay_seconds")] - public uint AdditionalDissolveDelaySeconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.AdditionalDissolveDelaySeconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class KnownNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.KnownNeuronData = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class KnownNeuronData - { - [CandidName("name")] - public string Name { get; set; } - - [CandidName("description")] - public string? Description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.Name = name; - this.Description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - [CandidName("known_neurons")] - public List KnownNeurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.KnownNeurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - [CandidName("neuron_ids")] - public List NeuronIds { get; set; } - - [CandidName("include_neurons_readable_by_caller")] - public bool IncludeNeuronsReadableByCaller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.NeuronIds = neuronIds; - this.IncludeNeuronsReadableByCaller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - [CandidName("neuron_infos")] - public Dictionary NeuronInfos { get; set; } - - [CandidName("full_neurons")] - public List FullNeurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.NeuronInfos = neuronInfos; - this.FullNeurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - [CandidName("node_providers")] - public List NodeProviders { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.NodeProviders = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - [CandidName("include_reward_status")] - public List IncludeRewardStatus { get; set; } - - [CandidName("before_proposal")] - public NeuronId? BeforeProposal { get; set; } - - [CandidName("limit")] - public uint Limit { get; set; } - - [CandidName("exclude_topic")] - public List ExcludeTopic { get; set; } - - [CandidName("include_status")] - public List IncludeStatus { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.IncludeRewardStatus = includeRewardStatus; - this.BeforeProposal = beforeProposal; - this.Limit = limit; - this.ExcludeTopic = excludeTopic; - this.IncludeStatus = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - [CandidName("proposal_info")] - public List ProposalInfo { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.ProposalInfo = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - [CandidName("proposal_id")] - public NeuronId? ProposalId { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.ProposalId = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("command")] - public Command? Command { get; set; } - - [CandidName("neuron_id_or_subaccount")] - public NeuronIdOrSubaccount? NeuronIdOrSubaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.Id = id; - this.Command = command; - this.NeuronIdOrSubaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - [CandidName("command")] - public Command1? Command { get; set; } - - public ManageNeuronResponse(Command1? command) - { - this.Command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Merge - { - [CandidName("source_neuron_id")] - public NeuronId? SourceNeuronId { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.SourceNeuronId = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturity - { - [CandidName("percentage_to_merge")] - public uint PercentageToMerge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.PercentageToMerge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class MergeMaturityResponse - { - [CandidName("merged_maturity_e8s")] - public ulong MergedMaturityE8s { get; set; } - - [CandidName("new_stake_e8s")] - public ulong NewStakeE8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.MergedMaturityE8s = mergedMaturityE8s; - this.NewStakeE8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Motion - { - [CandidName("motion_text")] - public string MotionText { get; set; } - - public Motion(string motionText) - { - this.MotionText = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NetworkEconomics - { - [CandidName("neuron_minimum_stake_e8s")] - public ulong NeuronMinimumStakeE8s { get; set; } - - [CandidName("max_proposals_to_keep_per_topic")] - public uint MaxProposalsToKeepPerTopic { get; set; } - - [CandidName("neuron_management_fee_per_proposal_e8s")] - public ulong NeuronManagementFeePerProposalE8s { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("transaction_fee_e8s")] - public ulong TransactionFeeE8s { get; set; } - - [CandidName("neuron_spawn_dissolve_delay_seconds")] - public ulong NeuronSpawnDissolveDelaySeconds { get; set; } - - [CandidName("minimum_icp_xdr_rate")] - public ulong MinimumIcpXdrRate { get; set; } - - [CandidName("maximum_node_provider_rewards_e8s")] - public ulong MaximumNodeProviderRewardsE8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.NeuronMinimumStakeE8s = neuronMinimumStakeE8s; - this.MaxProposalsToKeepPerTopic = maxProposalsToKeepPerTopic; - this.NeuronManagementFeePerProposalE8s = neuronManagementFeePerProposalE8s; - this.RejectCostE8s = rejectCostE8s; - this.TransactionFeeE8s = transactionFeeE8s; - this.NeuronSpawnDissolveDelaySeconds = neuronSpawnDissolveDelaySeconds; - this.MinimumIcpXdrRate = minimumIcpXdrRate; - this.MaximumNodeProviderRewardsE8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("controller")] - public Principal? Controller { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("kyc_verified")] - public bool KycVerified { get; set; } - - [CandidName("not_for_profit")] - public bool NotForProfit { get; set; } - - [CandidName("maturity_e8s_equivalent")] - public ulong MaturityE8sEquivalent { get; set; } - - [CandidName("cached_neuron_stake_e8s")] - public ulong CachedNeuronStakeE8s { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("aging_since_timestamp_seconds")] - public ulong AgingSinceTimestampSeconds { get; set; } - - [CandidName("hot_keys")] - public List HotKeys { get; set; } - - [CandidName("account")] - public List Account { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("dissolve_state")] - public DissolveState? DissolveState { get; set; } - - [CandidName("followees")] - public Dictionary Followees { get; set; } - - [CandidName("neuron_fees_e8s")] - public ulong NeuronFeesE8s { get; set; } - - [CandidName("transfer")] - public NeuronStakeTransfer? Transfer { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.Id = id; - this.Controller = controller; - this.RecentBallots = recentBallots; - this.KycVerified = kycVerified; - this.NotForProfit = notForProfit; - this.MaturityE8sEquivalent = maturityE8sEquivalent; - this.CachedNeuronStakeE8s = cachedNeuronStakeE8s; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.AgingSinceTimestampSeconds = agingSinceTimestampSeconds; - this.HotKeys = hotKeys; - this.Account = account; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.DissolveState = dissolveState; - this.Followees = followees; - this.NeuronFeesE8s = neuronFeesE8s; - this.Transfer = transfer; - this.KnownNeuronData = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class NeuronId - { - [CandidName("id")] - public ulong Id { get; set; } - - public NeuronId(ulong id) - { - this.Id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public List? Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId? NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - [CandidName("command")] - public Command2? Command { get; set; } - - [CandidName("timestamp")] - public ulong Timestamp { get; set; } - - public NeuronInFlightCommand(Command2? command, ulong timestamp) - { - this.Command = command; - this.Timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - [CandidName("recent_ballots")] - public List RecentBallots { get; set; } - - [CandidName("created_timestamp_seconds")] - public ulong CreatedTimestampSeconds { get; set; } - - [CandidName("state")] - public int State { get; set; } - - [CandidName("stake_e8s")] - public ulong StakeE8s { get; set; } - - [CandidName("joined_community_fund_timestamp_seconds")] - public ulong? JoinedCommunityFundTimestampSeconds { get; set; } - - [CandidName("retrieved_at_timestamp_seconds")] - public ulong RetrievedAtTimestampSeconds { get; set; } - - [CandidName("known_neuron_data")] - public KnownNeuronData? KnownNeuronData { get; set; } - - [CandidName("voting_power")] - public ulong VotingPower { get; set; } - - [CandidName("age_seconds")] - public ulong AgeSeconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - this.RecentBallots = recentBallots; - this.CreatedTimestampSeconds = createdTimestampSeconds; - this.State = state; - this.StakeE8s = stakeE8s; - this.JoinedCommunityFundTimestampSeconds = joinedCommunityFundTimestampSeconds; - this.RetrievedAtTimestampSeconds = retrievedAtTimestampSeconds; - this.KnownNeuronData = knownNeuronData; - this.VotingPower = votingPower; - this.AgeSeconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - [CandidName("to_subaccount")] - public List ToSubaccount { get; set; } - - [CandidName("neuron_stake_e8s")] - public ulong NeuronStakeE8s { get; set; } - - [CandidName("from")] - public Principal? From { get; set; } - - [CandidName("memo")] - public ulong Memo { get; set; } - - [CandidName("from_subaccount")] - public List FromSubaccount { get; set; } - - [CandidName("transfer_timestamp")] - public ulong TransferTimestamp { get; set; } - - [CandidName("block_height")] - public ulong BlockHeight { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.ToSubaccount = toSubaccount; - this.NeuronStakeE8s = neuronStakeE8s; - this.From = from; - this.Memo = memo; - this.FromSubaccount = fromSubaccount; - this.TransferTimestamp = transferTimestamp; - this.BlockHeight = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - [CandidName("id")] - public Principal? Id { get; set; } - - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.Id = id; - this.RewardAccount = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RemoveHotKey? RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey? AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo? StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo? StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay? IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo? JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp? SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class Proposal - { - [CandidName("url")] - public string Url { get; set; } - - [CandidName("title")] - public string? Title { get; set; } - - [CandidName("action")] - public Action? Action { get; set; } - - [CandidName("summary")] - public string Summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.Url = url; - this.Title = title; - this.Action = action; - this.Summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("wait_for_quiet_state")] - public WaitForQuietState? WaitForQuietState { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.Id = id; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.WaitForQuietState = waitForQuietState; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - [CandidName("id")] - public NeuronId? Id { get; set; } - - [CandidName("status")] - public int Status { get; set; } - - [CandidName("topic")] - public int Topic { get; set; } - - [CandidName("failure_reason")] - public GovernanceError? FailureReason { get; set; } - - [CandidName("ballots")] - public Dictionary Ballots { get; set; } - - [CandidName("proposal_timestamp_seconds")] - public ulong ProposalTimestampSeconds { get; set; } - - [CandidName("reward_event_round")] - public ulong RewardEventRound { get; set; } - - [CandidName("deadline_timestamp_seconds")] - public ulong? DeadlineTimestampSeconds { get; set; } - - [CandidName("failed_timestamp_seconds")] - public ulong FailedTimestampSeconds { get; set; } - - [CandidName("reject_cost_e8s")] - public ulong RejectCostE8s { get; set; } - - [CandidName("latest_tally")] - public Tally? LatestTally { get; set; } - - [CandidName("reward_status")] - public int RewardStatus { get; set; } - - [CandidName("decided_timestamp_seconds")] - public ulong DecidedTimestampSeconds { get; set; } - - [CandidName("proposal")] - public Proposal? Proposal { get; set; } - - [CandidName("proposer")] - public NeuronId? Proposer { get; set; } - - [CandidName("executed_timestamp_seconds")] - public ulong ExecutedTimestampSeconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.Id = id; - this.Status = status; - this.Topic = topic; - this.FailureReason = failureReason; - this.Ballots = ballots; - this.ProposalTimestampSeconds = proposalTimestampSeconds; - this.RewardEventRound = rewardEventRound; - this.DeadlineTimestampSeconds = deadlineTimestampSeconds; - this.FailedTimestampSeconds = failedTimestampSeconds; - this.RejectCostE8s = rejectCostE8s; - this.LatestTally = latestTally; - this.RewardStatus = rewardStatus; - this.DecidedTimestampSeconds = decidedTimestampSeconds; - this.Proposal = proposal; - this.Proposer = proposer; - this.ExecutedTimestampSeconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RegisterVote - { - [CandidName("vote")] - public int Vote { get; set; } - - [CandidName("proposal")] - public NeuronId? Proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.Vote = vote; - this.Proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - [CandidName("hot_key_to_remove")] - public Principal? HotKeyToRemove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.HotKeyToRemove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result1 - { - [VariantTagProperty()] - public Result1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Result1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.Error, value); } - - public NeuronId? NeuronId { get => this.Tag == Result1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result1Tag.NeuronId, value); } - - public Result1(Result1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result1() - { - } - } - - public enum Result1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result2 - { - [VariantTagProperty()] - public Result2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Neuron? Ok { get => this.Tag == Result2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result2Tag.Err, value); } - - public Result2(Result2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result2() - { - } - } - - public enum Result2Tag - { - Ok, - Err - } -} - -Type File: 'Result3' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result3 - { - [VariantTagProperty()] - public Result3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardNodeProviders? Ok { get => this.Tag == Result3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result3Tag.Err, value); } - - public Result3(Result3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result3() - { - } - } - - public enum Result3Tag - { - Ok, - Err - } -} - -Type File: 'Result4' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result4 - { - [VariantTagProperty()] - public Result4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronInfo? Ok { get => this.Tag == Result4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result4Tag.Err, value); } - - public Result4(Result4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result4() - { - } - } - - public enum Result4Tag - { - Ok, - Err - } -} - -Type File: 'Result5' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result5 - { - [VariantTagProperty()] - public Result5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? Ok { get => this.Tag == Result5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result5Tag.Err, value); } - - public Result5(Result5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result5() - { - } - } - - public enum Result5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - [CandidName("day_after_genesis")] - public ulong DayAfterGenesis { get; set; } - - [CandidName("actual_timestamp_seconds")] - public ulong ActualTimestampSeconds { get; set; } - - [CandidName("distributed_e8s_equivalent")] - public ulong DistributedE8sEquivalent { get; set; } - - [CandidName("settled_proposals")] - public List SettledProposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.DayAfterGenesis = dayAfterGenesis; - this.ActualTimestampSeconds = actualTimestampSeconds; - this.DistributedE8sEquivalent = distributedE8sEquivalent; - this.SettledProposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardToNeuron? RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount? RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - [CandidName("node_provider")] - public NodeProvider? NodeProvider { get; set; } - - [CandidName("reward_mode")] - public RewardMode? RewardMode { get; set; } - - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.NodeProvider = nodeProvider; - this.RewardMode = rewardMode; - this.AmountE8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - [CandidName("use_registry_derived_rewards")] - public bool? UseRegistryDerivedRewards { get; set; } - - [CandidName("rewards")] - public List Rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.UseRegistryDerivedRewards = useRegistryDerivedRewards; - this.Rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class RewardToAccount - { - [CandidName("to_account")] - public AccountIdentifier? ToAccount { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.ToAccount = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class RewardToNeuron - { - [CandidName("dissolve_delay_seconds")] - public ulong DissolveDelaySeconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.DissolveDelaySeconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using EdjCase.ICP.Candid.Mapping; -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - [CandidName("default_followees")] - public Dictionary DefaultFollowees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.DefaultFollowees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class SetDissolveTimestamp - { - [CandidName("dissolve_timestamp_seconds")] - public ulong DissolveTimestampSeconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.DissolveTimestampSeconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Mapping; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - [CandidName("percentage_to_spawn")] - public uint? PercentageToSpawn { get; set; } - - [CandidName("new_controller")] - public Principal? NewController { get; set; } - - [CandidName("nonce")] - public ulong? Nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.PercentageToSpawn = percentageToSpawn; - this.NewController = newController; - this.Nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class SpawnResponse - { - [CandidName("created_neuron_id")] - public NeuronId? CreatedNeuronId { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.CreatedNeuronId = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Split - { - [CandidName("amount_e8s")] - public ulong AmountE8s { get; set; } - - public Split(ulong amountE8s) - { - this.AmountE8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class Tally - { - [CandidName("no")] - public ulong No { get; set; } - - [CandidName("yes")] - public ulong Yes { get; set; } - - [CandidName("total")] - public ulong Total { get; set; } - - [CandidName("timestamp_seconds")] - public ulong TimestampSeconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.No = no; - this.Yes = yes; - this.Total = total; - this.TimestampSeconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - [CandidName("reward_account")] - public AccountIdentifier? RewardAccount { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.RewardAccount = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -using EdjCase.ICP.Candid.Mapping; - -namespace Test -{ - public class WaitForQuietState - { - [CandidName("current_deadline_timestamp_seconds")] - public ulong CurrentDeadlineTimestampSeconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.CurrentDeadlineTimestampSeconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap deleted file mode 100644 index 262837c3..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_False_UseOptionalValue_False.snap +++ /dev/null @@ -1,3418 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - - public static Action RegisterKnownNeuron(KnownNeuron info) - { - return new Action(ActionTag.RegisterKnownNeuron, info); - } - - public static Action ManageNeuron(ManageNeuron info) - { - return new Action(ActionTag.ManageNeuron, info); - } - - public static Action ExecuteNnsFunction(ExecuteNnsFunction info) - { - return new Action(ActionTag.ExecuteNnsFunction, info); - } - - public static Action RewardNodeProvider(RewardNodeProvider info) - { - return new Action(ActionTag.RewardNodeProvider, info); - } - - public static Action SetDefaultFollowees(SetDefaultFollowees info) - { - return new Action(ActionTag.SetDefaultFollowees, info); - } - - public static Action RewardNodeProviders(RewardNodeProviders info) - { - return new Action(ActionTag.RewardNodeProviders, info); - } - - public static Action ManageNetworkEconomics(NetworkEconomics info) - { - return new Action(ActionTag.ManageNetworkEconomics, info); - } - - public static Action ApproveGenesisKyc(ApproveGenesisKyc info) - { - return new Action(ActionTag.ApproveGenesisKyc, info); - } - - public static Action AddOrRemoveNodeProvider(AddOrRemoveNodeProvider info) - { - return new Action(ActionTag.AddOrRemoveNodeProvider, info); - } - - public static Action Motion(Motion info) - { - return new Action(ActionTag.Motion, info); - } - - public KnownNeuron AsRegisterKnownNeuron() - { - this.ValidateTag(ActionTag.RegisterKnownNeuron); - return (KnownNeuron)this.Value!; - } - - public ManageNeuron AsManageNeuron() - { - this.ValidateTag(ActionTag.ManageNeuron); - return (ManageNeuron)this.Value!; - } - - public ExecuteNnsFunction AsExecuteNnsFunction() - { - this.ValidateTag(ActionTag.ExecuteNnsFunction); - return (ExecuteNnsFunction)this.Value!; - } - - public RewardNodeProvider AsRewardNodeProvider() - { - this.ValidateTag(ActionTag.RewardNodeProvider); - return (RewardNodeProvider)this.Value!; - } - - public SetDefaultFollowees AsSetDefaultFollowees() - { - this.ValidateTag(ActionTag.SetDefaultFollowees); - return (SetDefaultFollowees)this.Value!; - } - - public RewardNodeProviders AsRewardNodeProviders() - { - this.ValidateTag(ActionTag.RewardNodeProviders); - return (RewardNodeProviders)this.Value!; - } - - public NetworkEconomics AsManageNetworkEconomics() - { - this.ValidateTag(ActionTag.ManageNetworkEconomics); - return (NetworkEconomics)this.Value!; - } - - public ApproveGenesisKyc AsApproveGenesisKyc() - { - this.ValidateTag(ActionTag.ApproveGenesisKyc); - return (ApproveGenesisKyc)this.Value!; - } - - public AddOrRemoveNodeProvider AsAddOrRemoveNodeProvider() - { - this.ValidateTag(ActionTag.AddOrRemoveNodeProvider); - return (AddOrRemoveNodeProvider)this.Value!; - } - - public Motion AsMotion() - { - this.ValidateTag(ActionTag.Motion); - return (Motion)this.Value!; - } - - private void ValidateTag(ActionTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - public Principal? new_hot_key { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - public Change? change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test; - -namespace Test -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId? proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public static By NeuronIdOrSubaccount(By.NeuronIdOrSubaccountInfo info) - { - return new By(ByTag.NeuronIdOrSubaccount, info); - } - - public static By MemoAndController(ClaimOrRefreshNeuronFromAccount info) - { - return new By(ByTag.MemoAndController, info); - } - - public static By Memo(ulong info) - { - return new By(ByTag.Memo, info); - } - - public By.NeuronIdOrSubaccountInfo AsNeuronIdOrSubaccount() - { - this.ValidateTag(ByTag.NeuronIdOrSubaccount); - return (By.NeuronIdOrSubaccountInfo)this.Value!; - } - - public ClaimOrRefreshNeuronFromAccount AsMemoAndController() - { - this.ValidateTag(ByTag.MemoAndController); - return (ClaimOrRefreshNeuronFromAccount)this.Value!; - } - - public ulong AsMemo() - { - this.ValidateTag(ByTag.Memo); - return (ulong)this.Value!; - } - - private void ValidateTag(ByTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - - public static Change ToRemove(NodeProvider info) - { - return new Change(ChangeTag.ToRemove, info); - } - - public static Change ToAdd(NodeProvider info) - { - return new Change(ChangeTag.ToAdd, info); - } - - public NodeProvider AsToRemove() - { - this.ValidateTag(ChangeTag.ToRemove); - return (NodeProvider)this.Value!; - } - - public NodeProvider AsToAdd() - { - this.ValidateTag(ChangeTag.ToAdd); - return (NodeProvider)this.Value!; - } - - private void ValidateTag(ChangeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - public By? by { get; set; } - - public ClaimOrRefresh(By? by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal? controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1? result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1? result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - public NeuronId? refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - - public static Command Spawn(Spawn info) - { - return new Command(CommandTag.Spawn, info); - } - - public static Command Split(Split info) - { - return new Command(CommandTag.Split, info); - } - - public static Command Follow(Follow info) - { - return new Command(CommandTag.Follow, info); - } - - public static Command ClaimOrRefresh(ClaimOrRefresh info) - { - return new Command(CommandTag.ClaimOrRefresh, info); - } - - public static Command Configure(Configure info) - { - return new Command(CommandTag.Configure, info); - } - - public static Command RegisterVote(RegisterVote info) - { - return new Command(CommandTag.RegisterVote, info); - } - - public static Command Merge(Merge info) - { - return new Command(CommandTag.Merge, info); - } - - public static Command DisburseToNeuron(DisburseToNeuron info) - { - return new Command(CommandTag.DisburseToNeuron, info); - } - - public static Command MakeProposal(Proposal info) - { - return new Command(CommandTag.MakeProposal, info); - } - - public static Command MergeMaturity(MergeMaturity info) - { - return new Command(CommandTag.MergeMaturity, info); - } - - public static Command Disburse(Disburse info) - { - return new Command(CommandTag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(CommandTag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(CommandTag.Split); - return (Split)this.Value!; - } - - public Follow AsFollow() - { - this.ValidateTag(CommandTag.Follow); - return (Follow)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefresh() - { - this.ValidateTag(CommandTag.ClaimOrRefresh); - return (ClaimOrRefresh)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(CommandTag.Configure); - return (Configure)this.Value!; - } - - public RegisterVote AsRegisterVote() - { - this.ValidateTag(CommandTag.RegisterVote); - return (RegisterVote)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(CommandTag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(CommandTag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public Proposal AsMakeProposal() - { - this.ValidateTag(CommandTag.MakeProposal); - return (Proposal)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(CommandTag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(CommandTag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(CommandTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command_1(Command_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public static Command_1 Error(GovernanceError info) - { - return new Command_1(Command_1Tag.Error, info); - } - - public static Command_1 Spawn(SpawnResponse info) - { - return new Command_1(Command_1Tag.Spawn, info); - } - - public static Command_1 Split(SpawnResponse info) - { - return new Command_1(Command_1Tag.Split, info); - } - - public static Command_1 Follow(Command_1.FollowInfo info) - { - return new Command_1(Command_1Tag.Follow, info); - } - - public static Command_1 ClaimOrRefresh(ClaimOrRefreshResponse info) - { - return new Command_1(Command_1Tag.ClaimOrRefresh, info); - } - - public static Command_1 Configure(Command_1.ConfigureInfo info) - { - return new Command_1(Command_1Tag.Configure, info); - } - - public static Command_1 RegisterVote(Command_1.RegisterVoteInfo info) - { - return new Command_1(Command_1Tag.RegisterVote, info); - } - - public static Command_1 Merge(Command_1.MergeInfo info) - { - return new Command_1(Command_1Tag.Merge, info); - } - - public static Command_1 DisburseToNeuron(SpawnResponse info) - { - return new Command_1(Command_1Tag.DisburseToNeuron, info); - } - - public static Command_1 MakeProposal(MakeProposalResponse info) - { - return new Command_1(Command_1Tag.MakeProposal, info); - } - - public static Command_1 MergeMaturity(MergeMaturityResponse info) - { - return new Command_1(Command_1Tag.MergeMaturity, info); - } - - public static Command_1 Disburse(DisburseResponse info) - { - return new Command_1(Command_1Tag.Disburse, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Command_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public SpawnResponse AsSpawn() - { - this.ValidateTag(Command_1Tag.Spawn); - return (SpawnResponse)this.Value!; - } - - public SpawnResponse AsSplit() - { - this.ValidateTag(Command_1Tag.Split); - return (SpawnResponse)this.Value!; - } - - public Command_1.FollowInfo AsFollow() - { - this.ValidateTag(Command_1Tag.Follow); - return (Command_1.FollowInfo)this.Value!; - } - - public ClaimOrRefreshResponse AsClaimOrRefresh() - { - this.ValidateTag(Command_1Tag.ClaimOrRefresh); - return (ClaimOrRefreshResponse)this.Value!; - } - - public Command_1.ConfigureInfo AsConfigure() - { - this.ValidateTag(Command_1Tag.Configure); - return (Command_1.ConfigureInfo)this.Value!; - } - - public Command_1.RegisterVoteInfo AsRegisterVote() - { - this.ValidateTag(Command_1Tag.RegisterVote); - return (Command_1.RegisterVoteInfo)this.Value!; - } - - public Command_1.MergeInfo AsMerge() - { - this.ValidateTag(Command_1Tag.Merge); - return (Command_1.MergeInfo)this.Value!; - } - - public SpawnResponse AsDisburseToNeuron() - { - this.ValidateTag(Command_1Tag.DisburseToNeuron); - return (SpawnResponse)this.Value!; - } - - public MakeProposalResponse AsMakeProposal() - { - this.ValidateTag(Command_1Tag.MakeProposal); - return (MakeProposalResponse)this.Value!; - } - - public MergeMaturityResponse AsMergeMaturity() - { - this.ValidateTag(Command_1Tag.MergeMaturity); - return (MergeMaturityResponse)this.Value!; - } - - public DisburseResponse AsDisburse() - { - this.ValidateTag(Command_1Tag.Disburse); - return (DisburseResponse)this.Value!; - } - - private void ValidateTag(Command_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Command_2(Command_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - - public static Command_2 Spawn(Spawn info) - { - return new Command_2(Command_2Tag.Spawn, info); - } - - public static Command_2 Split(Split info) - { - return new Command_2(Command_2Tag.Split, info); - } - - public static Command_2 Configure(Configure info) - { - return new Command_2(Command_2Tag.Configure, info); - } - - public static Command_2 Merge(Merge info) - { - return new Command_2(Command_2Tag.Merge, info); - } - - public static Command_2 DisburseToNeuron(DisburseToNeuron info) - { - return new Command_2(Command_2Tag.DisburseToNeuron, info); - } - - public static Command_2 ClaimOrRefreshNeuron(ClaimOrRefresh info) - { - return new Command_2(Command_2Tag.ClaimOrRefreshNeuron, info); - } - - public static Command_2 MergeMaturity(MergeMaturity info) - { - return new Command_2(Command_2Tag.MergeMaturity, info); - } - - public static Command_2 Disburse(Disburse info) - { - return new Command_2(Command_2Tag.Disburse, info); - } - - public Spawn AsSpawn() - { - this.ValidateTag(Command_2Tag.Spawn); - return (Spawn)this.Value!; - } - - public Split AsSplit() - { - this.ValidateTag(Command_2Tag.Split); - return (Split)this.Value!; - } - - public Configure AsConfigure() - { - this.ValidateTag(Command_2Tag.Configure); - return (Configure)this.Value!; - } - - public Merge AsMerge() - { - this.ValidateTag(Command_2Tag.Merge); - return (Merge)this.Value!; - } - - public DisburseToNeuron AsDisburseToNeuron() - { - this.ValidateTag(Command_2Tag.DisburseToNeuron); - return (DisburseToNeuron)this.Value!; - } - - public ClaimOrRefresh AsClaimOrRefreshNeuron() - { - this.ValidateTag(Command_2Tag.ClaimOrRefreshNeuron); - return (ClaimOrRefresh)this.Value!; - } - - public MergeMaturity AsMergeMaturity() - { - this.ValidateTag(Command_2Tag.MergeMaturity); - return (MergeMaturity)this.Value!; - } - - public Disburse AsDisburse() - { - this.ValidateTag(Command_2Tag.Disburse); - return (Disburse)this.Value!; - } - - private void ValidateTag(Command_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test; - -namespace Test -{ - public class Configure - { - public Operation? operation { get; set; } - - public Configure(Operation? operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test; - -namespace Test -{ - public class Disburse - { - public AccountIdentifier? to_account { get; set; } - - public Amount? amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal? new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - - public static DissolveState DissolveDelaySeconds(ulong info) - { - return new DissolveState(DissolveStateTag.DissolveDelaySeconds, info); - } - - public static DissolveState WhenDissolvedTimestampSeconds(ulong info) - { - return new DissolveState(DissolveStateTag.WhenDissolvedTimestampSeconds, info); - } - - public ulong AsDissolveDelaySeconds() - { - this.ValidateTag(DissolveStateTag.DissolveDelaySeconds); - return (ulong)this.Value!; - } - - public ulong AsWhenDissolvedTimestampSeconds() - { - this.ValidateTag(DissolveStateTag.WhenDissolvedTimestampSeconds); - return (ulong)this.Value!; - } - - private void ValidateTag(DissolveStateTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics? metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics? economics { get; set; } - - public RewardEvent? latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test; - -namespace Test -{ - public class KnownNeuron - { - public NeuronId? id { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string? description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId? before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - public NeuronId? proposal_id { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test; - -namespace Test -{ - public class ManageNeuron - { - public NeuronId? id { get; set; } - - public Command? command { get; set; } - - public NeuronIdOrSubaccount? neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - public Command_1? command { get; set; } - - public ManageNeuronResponse(Command_1? command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test; - -namespace Test -{ - public class Merge - { - public NeuronId? source_neuron_id { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - public NeuronId? id { get; set; } - - public Principal? controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState? dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer? transfer { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; -using System; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - - public static NeuronIdOrSubaccount Subaccount(List info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.Subaccount, info); - } - - public static NeuronIdOrSubaccount NeuronId(NeuronId info) - { - return new NeuronIdOrSubaccount(NeuronIdOrSubaccountTag.NeuronId, info); - } - - public List AsSubaccount() - { - this.ValidateTag(NeuronIdOrSubaccountTag.Subaccount); - return (List)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(NeuronIdOrSubaccountTag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(NeuronIdOrSubaccountTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - public Command_2? command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2? command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal? from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - public Principal? id { get; set; } - - public AccountIdentifier? reward_account { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public static Operation RemoveHotKey(RemoveHotKey info) - { - return new Operation(OperationTag.RemoveHotKey, info); - } - - public static Operation AddHotKey(AddHotKey info) - { - return new Operation(OperationTag.AddHotKey, info); - } - - public static Operation StopDissolving(Operation.StopDissolvingInfo info) - { - return new Operation(OperationTag.StopDissolving, info); - } - - public static Operation StartDissolving(Operation.StartDissolvingInfo info) - { - return new Operation(OperationTag.StartDissolving, info); - } - - public static Operation IncreaseDissolveDelay(IncreaseDissolveDelay info) - { - return new Operation(OperationTag.IncreaseDissolveDelay, info); - } - - public static Operation JoinCommunityFund(Operation.JoinCommunityFundInfo info) - { - return new Operation(OperationTag.JoinCommunityFund, info); - } - - public static Operation SetDissolveTimestamp(SetDissolveTimestamp info) - { - return new Operation(OperationTag.SetDissolveTimestamp, info); - } - - public RemoveHotKey AsRemoveHotKey() - { - this.ValidateTag(OperationTag.RemoveHotKey); - return (RemoveHotKey)this.Value!; - } - - public AddHotKey AsAddHotKey() - { - this.ValidateTag(OperationTag.AddHotKey); - return (AddHotKey)this.Value!; - } - - public Operation.StopDissolvingInfo AsStopDissolving() - { - this.ValidateTag(OperationTag.StopDissolving); - return (Operation.StopDissolvingInfo)this.Value!; - } - - public Operation.StartDissolvingInfo AsStartDissolving() - { - this.ValidateTag(OperationTag.StartDissolving); - return (Operation.StartDissolvingInfo)this.Value!; - } - - public IncreaseDissolveDelay AsIncreaseDissolveDelay() - { - this.ValidateTag(OperationTag.IncreaseDissolveDelay); - return (IncreaseDissolveDelay)this.Value!; - } - - public Operation.JoinCommunityFundInfo AsJoinCommunityFund() - { - this.ValidateTag(OperationTag.JoinCommunityFund); - return (Operation.JoinCommunityFundInfo)this.Value!; - } - - public SetDissolveTimestamp AsSetDissolveTimestamp() - { - this.ValidateTag(OperationTag.SetDissolveTimestamp); - return (SetDissolveTimestamp)this.Value!; - } - - private void ValidateTag(OperationTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test; - -namespace Test -{ - public class Proposal - { - public string url { get; set; } - - public string? title { get; set; } - - public Action? action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - public NeuronId? id { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public WaitForQuietState? wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - public NeuronId? id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test; - -namespace Test -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId? proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - public Principal? hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - - public static Result Ok() - { - return new Result(ResultTag.Ok, null); - } - - public static Result Err(GovernanceError info) - { - return new Result(ResultTag.Err, info); - } - - public GovernanceError AsErr() - { - this.ValidateTag(ResultTag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(ResultTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_1(Result_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - - public static Result_1 Error(GovernanceError info) - { - return new Result_1(Result_1Tag.Error, info); - } - - public static Result_1 NeuronId(NeuronId info) - { - return new Result_1(Result_1Tag.NeuronId, info); - } - - public GovernanceError AsError() - { - this.ValidateTag(Result_1Tag.Error); - return (GovernanceError)this.Value!; - } - - public NeuronId AsNeuronId() - { - this.ValidateTag(Result_1Tag.NeuronId); - return (NeuronId)this.Value!; - } - - private void ValidateTag(Result_1Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_2(Result_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - - public static Result_2 Ok(Neuron info) - { - return new Result_2(Result_2Tag.Ok, info); - } - - public static Result_2 Err(GovernanceError info) - { - return new Result_2(Result_2Tag.Err, info); - } - - public Neuron AsOk() - { - this.ValidateTag(Result_2Tag.Ok); - return (Neuron)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_2Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_2Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_3(Result_3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - - public static Result_3 Ok(RewardNodeProviders info) - { - return new Result_3(Result_3Tag.Ok, info); - } - - public static Result_3 Err(GovernanceError info) - { - return new Result_3(Result_3Tag.Err, info); - } - - public RewardNodeProviders AsOk() - { - this.ValidateTag(Result_3Tag.Ok); - return (RewardNodeProviders)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_3Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_3Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_4(Result_4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - - public static Result_4 Ok(NeuronInfo info) - { - return new Result_4(Result_4Tag.Ok, info); - } - - public static Result_4 Err(GovernanceError info) - { - return new Result_4(Result_4Tag.Err, info); - } - - public NeuronInfo AsOk() - { - this.ValidateTag(Result_4Tag.Ok); - return (NeuronInfo)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_4Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_4Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Result_5(Result_5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - - public static Result_5 Ok(NodeProvider info) - { - return new Result_5(Result_5Tag.Ok, info); - } - - public static Result_5 Err(GovernanceError info) - { - return new Result_5(Result_5Tag.Err, info); - } - - public NodeProvider AsOk() - { - this.ValidateTag(Result_5Tag.Ok); - return (NodeProvider)this.Value!; - } - - public GovernanceError AsErr() - { - this.ValidateTag(Result_5Tag.Err); - return (GovernanceError)this.Value!; - } - - private void ValidateTag(Result_5Tag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - - public static RewardMode RewardToNeuron(RewardToNeuron info) - { - return new RewardMode(RewardModeTag.RewardToNeuron, info); - } - - public static RewardMode RewardToAccount(RewardToAccount info) - { - return new RewardMode(RewardModeTag.RewardToAccount, info); - } - - public RewardToNeuron AsRewardToNeuron() - { - this.ValidateTag(RewardModeTag.RewardToNeuron); - return (RewardToNeuron)this.Value!; - } - - public RewardToAccount AsRewardToAccount() - { - this.ValidateTag(RewardModeTag.RewardToAccount); - return (RewardToAccount)this.Value!; - } - - private void ValidateTag(RewardModeTag tag) - { - if (!this.Tag.Equals(tag)) - { - throw new InvalidOperationException($"Cannot cast '{this.Tag}' to type '{tag}'"); - } - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - public NodeProvider? node_provider { get; set; } - - public RewardMode? reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test; - -namespace Test -{ - public class RewardToAccount - { - public AccountIdentifier? to_account { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal? new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test; - -namespace Test -{ - public class SpawnResponse - { - public NeuronId? created_neuron_id { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - public AccountIdentifier? reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -} diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap similarity index 100% rename from test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_True.snap rename to test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True.snap diff --git a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap b/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap deleted file mode 100644 index 2975fef5..00000000 --- a/test/Candid.Tests/Generators/__snapshots__/Governance_NoFolders_True_Nullable_True_KeepCandidCase_True_VariantsUseProperties_True_UseOptionalValue_False.snap +++ /dev/null @@ -1,2639 +0,0 @@ -using EdjCase.ICP.Agent.Agents; -using EdjCase.ICP.Candid.Models; -using EdjCase.ICP.Candid; -using System.Threading.Tasks; -using Test; -using System.Collections.Generic; -using EdjCase.ICP.Agent.Responses; - -namespace Test -{ - public class GovernanceApiClient - { - public IAgent Agent { get; } - - public Principal CanisterId { get; } - - public CandidConverter? Converter { get; } - - public GovernanceApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) - { - this.Agent = agent; - this.CanisterId = canisterId; - this.Converter = converter; - } - - public async Task claim_gtc_neurons(Principal arg0, List arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_gtc_neurons", arg); - return reply.ToObjects(this.Converter); - } - - public async Task claim_or_refresh_neuron_from_account(ClaimOrRefreshNeuronFromAccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "claim_or_refresh_neuron_from_account", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_build_metadata() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_build_metadata", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_full_neuron_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_full_neuron_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_monthly_node_provider_rewards() - { - CandidArg arg = CandidArg.FromCandid(); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "get_monthly_node_provider_rewards", arg); - return reply.ToObjects(this.Converter); - } - - public async Task _get_network_economics_parameters() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_network_economics_parameters", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_neuron_ids() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_ids", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_neuron_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_neuron_info_by_id_or_subaccount(NeuronIdOrSubaccount arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_neuron_info_by_id_or_subaccount", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task _get_node_provider_by_caller(NullValue arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_node_provider_by_caller", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task> _get_pending_proposals() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_pending_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects>(this.Converter); - } - - public async Task _get_proposal_info(ulong arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "get_proposal_info", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_known_neurons() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_known_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_neurons(ListNeurons arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_neurons", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_node_providers() - { - CandidArg arg = CandidArg.FromCandid(); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_node_providers", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task list_proposals(ListProposalInfo arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "list_proposals", arg); - CandidArg reply = response.ThrowOrGetReply(); - return reply.ToObjects(this.Converter); - } - - public async Task manage_neuron(ManageNeuron arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "manage_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task transfer_gtc_neuron(NeuronId arg0, NeuronId arg1) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0), CandidTypedValue.FromObject(arg1)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "transfer_gtc_neuron", arg); - return reply.ToObjects(this.Converter); - } - - public async Task update_node_provider(UpdateNodeProvider arg0) - { - CandidArg arg = CandidArg.FromCandid(CandidTypedValue.FromObject(arg0)); - CandidArg reply = await this.Agent.CallAndWaitAsync(this.CanisterId, "update_node_provider", arg); - return reply.ToObjects(this.Converter); - } - } -} - -Type File: 'AccountIdentifier' - -using System.Collections.Generic; - -namespace Test -{ - public class AccountIdentifier - { - public List hash { get; set; } - - public AccountIdentifier(List hash) - { - this.hash = hash; - } - - public AccountIdentifier() - { - } - } -} - -Type File: 'Action' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Action - { - [VariantTagProperty()] - public ActionTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public KnownNeuron? RegisterKnownNeuron { get => this.Tag == ActionTag.RegisterKnownNeuron ? (KnownNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RegisterKnownNeuron, value); } - - public ManageNeuron? ManageNeuron { get => this.Tag == ActionTag.ManageNeuron ? (ManageNeuron)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNeuron, value); } - - public ExecuteNnsFunction? ExecuteNnsFunction { get => this.Tag == ActionTag.ExecuteNnsFunction ? (ExecuteNnsFunction)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ExecuteNnsFunction, value); } - - public RewardNodeProvider? RewardNodeProvider { get => this.Tag == ActionTag.RewardNodeProvider ? (RewardNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProvider, value); } - - public SetDefaultFollowees? SetDefaultFollowees { get => this.Tag == ActionTag.SetDefaultFollowees ? (SetDefaultFollowees)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.SetDefaultFollowees, value); } - - public RewardNodeProviders? RewardNodeProviders { get => this.Tag == ActionTag.RewardNodeProviders ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.RewardNodeProviders, value); } - - public NetworkEconomics? ManageNetworkEconomics { get => this.Tag == ActionTag.ManageNetworkEconomics ? (NetworkEconomics)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ManageNetworkEconomics, value); } - - public ApproveGenesisKyc? ApproveGenesisKyc { get => this.Tag == ActionTag.ApproveGenesisKyc ? (ApproveGenesisKyc)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.ApproveGenesisKyc, value); } - - public AddOrRemoveNodeProvider? AddOrRemoveNodeProvider { get => this.Tag == ActionTag.AddOrRemoveNodeProvider ? (AddOrRemoveNodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.AddOrRemoveNodeProvider, value); } - - public Motion? Motion { get => this.Tag == ActionTag.Motion ? (Motion)this.Value! : default; set => (this.Tag, this.Value) = (ActionTag.Motion, value); } - - public Action(ActionTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Action() - { - } - } - - public enum ActionTag - { - RegisterKnownNeuron, - ManageNeuron, - ExecuteNnsFunction, - RewardNodeProvider, - SetDefaultFollowees, - RewardNodeProviders, - ManageNetworkEconomics, - ApproveGenesisKyc, - AddOrRemoveNodeProvider, - Motion - } -} - -Type File: 'AddHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class AddHotKey - { - public Principal? new_hot_key { get; set; } - - public AddHotKey(Principal? newHotKey) - { - this.new_hot_key = newHotKey; - } - - public AddHotKey() - { - } - } -} - -Type File: 'AddOrRemoveNodeProvider' - -using Test; - -namespace Test -{ - public class AddOrRemoveNodeProvider - { - public Change? change { get; set; } - - public AddOrRemoveNodeProvider(Change? change) - { - this.change = change; - } - - public AddOrRemoveNodeProvider() - { - } - } -} - -Type File: 'Amount' - -namespace Test -{ - public class Amount - { - public ulong e8s { get; set; } - - public Amount(ulong e8s) - { - this.e8s = e8s; - } - - public Amount() - { - } - } -} - -Type File: 'ApproveGenesisKyc' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ApproveGenesisKyc - { - public List principals { get; set; } - - public ApproveGenesisKyc(List principals) - { - this.principals = principals; - } - - public ApproveGenesisKyc() - { - } - } -} - -Type File: 'Ballot' - -namespace Test -{ - public class Ballot - { - public int vote { get; set; } - - public ulong voting_power { get; set; } - - public Ballot(int vote, ulong votingPower) - { - this.vote = vote; - this.voting_power = votingPower; - } - - public Ballot() - { - } - } -} - -Type File: 'BallotInfo' - -using Test; - -namespace Test -{ - public class BallotInfo - { - public int vote { get; set; } - - public NeuronId? proposal_id { get; set; } - - public BallotInfo(int vote, NeuronId? proposalId) - { - this.vote = vote; - this.proposal_id = proposalId; - } - - public BallotInfo() - { - } - } -} - -Type File: 'By' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class By - { - [VariantTagProperty()] - public ByTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public By.NeuronIdOrSubaccountInfo? NeuronIdOrSubaccount { get => this.Tag == ByTag.NeuronIdOrSubaccount ? (By.NeuronIdOrSubaccountInfo)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.NeuronIdOrSubaccount, value); } - - public ClaimOrRefreshNeuronFromAccount? MemoAndController { get => this.Tag == ByTag.MemoAndController ? (ClaimOrRefreshNeuronFromAccount)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.MemoAndController, value); } - - public ulong? Memo { get => this.Tag == ByTag.Memo ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (ByTag.Memo, value); } - - public By(ByTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected By() - { - } - - public class NeuronIdOrSubaccountInfo - { - public NeuronIdOrSubaccountInfo() - { - } - } - } - - public enum ByTag - { - NeuronIdOrSubaccount, - MemoAndController, - Memo - } -} - -Type File: 'Change' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Change - { - [VariantTagProperty()] - public ChangeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? ToRemove { get => this.Tag == ChangeTag.ToRemove ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToRemove, value); } - - public NodeProvider? ToAdd { get => this.Tag == ChangeTag.ToAdd ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (ChangeTag.ToAdd, value); } - - public Change(ChangeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Change() - { - } - } - - public enum ChangeTag - { - ToRemove, - ToAdd - } -} - -Type File: 'ClaimOrRefresh' - -using Test; - -namespace Test -{ - public class ClaimOrRefresh - { - public By? by { get; set; } - - public ClaimOrRefresh(By? by) - { - this.by = by; - } - - public ClaimOrRefresh() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccount' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccount - { - public Principal? controller { get; set; } - - public ulong memo { get; set; } - - public ClaimOrRefreshNeuronFromAccount(Principal? controller, ulong memo) - { - this.controller = controller; - this.memo = memo; - } - - public ClaimOrRefreshNeuronFromAccount() - { - } - } -} - -Type File: 'ClaimOrRefreshNeuronFromAccountResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshNeuronFromAccountResponse - { - public Result_1? result { get; set; } - - public ClaimOrRefreshNeuronFromAccountResponse(Result_1? result) - { - this.result = result; - } - - public ClaimOrRefreshNeuronFromAccountResponse() - { - } - } -} - -Type File: 'ClaimOrRefreshResponse' - -using Test; - -namespace Test -{ - public class ClaimOrRefreshResponse - { - public NeuronId? refreshed_neuron_id { get; set; } - - public ClaimOrRefreshResponse(NeuronId? refreshedNeuronId) - { - this.refreshed_neuron_id = refreshedNeuronId; - } - - public ClaimOrRefreshResponse() - { - } - } -} - -Type File: 'Command' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command - { - [VariantTagProperty()] - public CommandTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == CommandTag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Spawn, value); } - - public Split? Split { get => this.Tag == CommandTag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Split, value); } - - public Follow? Follow { get => this.Tag == CommandTag.Follow ? (Follow)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Follow, value); } - - public ClaimOrRefresh? ClaimOrRefresh { get => this.Tag == CommandTag.ClaimOrRefresh ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.ClaimOrRefresh, value); } - - public Configure? Configure { get => this.Tag == CommandTag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Configure, value); } - - public RegisterVote? RegisterVote { get => this.Tag == CommandTag.RegisterVote ? (RegisterVote)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.RegisterVote, value); } - - public Merge? Merge { get => this.Tag == CommandTag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == CommandTag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.DisburseToNeuron, value); } - - public Proposal? MakeProposal { get => this.Tag == CommandTag.MakeProposal ? (Proposal)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MakeProposal, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == CommandTag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == CommandTag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (CommandTag.Disburse, value); } - - public Command(CommandTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command() - { - } - } - - public enum CommandTag - { - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command_1 - { - [VariantTagProperty()] - public Command_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Command_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Error, value); } - - public SpawnResponse? Spawn { get => this.Tag == Command_1Tag.Spawn ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Spawn, value); } - - public SpawnResponse? Split { get => this.Tag == Command_1Tag.Split ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Split, value); } - - public Command_1.FollowInfo? Follow { get => this.Tag == Command_1Tag.Follow ? (Command_1.FollowInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Follow, value); } - - public ClaimOrRefreshResponse? ClaimOrRefresh { get => this.Tag == Command_1Tag.ClaimOrRefresh ? (ClaimOrRefreshResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.ClaimOrRefresh, value); } - - public Command_1.ConfigureInfo? Configure { get => this.Tag == Command_1Tag.Configure ? (Command_1.ConfigureInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Configure, value); } - - public Command_1.RegisterVoteInfo? RegisterVote { get => this.Tag == Command_1Tag.RegisterVote ? (Command_1.RegisterVoteInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.RegisterVote, value); } - - public Command_1.MergeInfo? Merge { get => this.Tag == Command_1Tag.Merge ? (Command_1.MergeInfo)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Merge, value); } - - public SpawnResponse? DisburseToNeuron { get => this.Tag == Command_1Tag.DisburseToNeuron ? (SpawnResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.DisburseToNeuron, value); } - - public MakeProposalResponse? MakeProposal { get => this.Tag == Command_1Tag.MakeProposal ? (MakeProposalResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MakeProposal, value); } - - public MergeMaturityResponse? MergeMaturity { get => this.Tag == Command_1Tag.MergeMaturity ? (MergeMaturityResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.MergeMaturity, value); } - - public DisburseResponse? Disburse { get => this.Tag == Command_1Tag.Disburse ? (DisburseResponse)this.Value! : default; set => (this.Tag, this.Value) = (Command_1Tag.Disburse, value); } - - public Command_1(Command_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_1() - { - } - - public class FollowInfo - { - public FollowInfo() - { - } - } - - public class ConfigureInfo - { - public ConfigureInfo() - { - } - } - - public class RegisterVoteInfo - { - public RegisterVoteInfo() - { - } - } - - public class MergeInfo - { - public MergeInfo() - { - } - } - } - - public enum Command_1Tag - { - Error, - Spawn, - Split, - Follow, - ClaimOrRefresh, - Configure, - RegisterVote, - Merge, - DisburseToNeuron, - MakeProposal, - MergeMaturity, - Disburse - } -} - -Type File: 'Command_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Command_2 - { - [VariantTagProperty()] - public Command_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Spawn? Spawn { get => this.Tag == Command_2Tag.Spawn ? (Spawn)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Spawn, value); } - - public Split? Split { get => this.Tag == Command_2Tag.Split ? (Split)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Split, value); } - - public Configure? Configure { get => this.Tag == Command_2Tag.Configure ? (Configure)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Configure, value); } - - public Merge? Merge { get => this.Tag == Command_2Tag.Merge ? (Merge)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Merge, value); } - - public DisburseToNeuron? DisburseToNeuron { get => this.Tag == Command_2Tag.DisburseToNeuron ? (DisburseToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.DisburseToNeuron, value); } - - public ClaimOrRefresh? ClaimOrRefreshNeuron { get => this.Tag == Command_2Tag.ClaimOrRefreshNeuron ? (ClaimOrRefresh)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.ClaimOrRefreshNeuron, value); } - - public MergeMaturity? MergeMaturity { get => this.Tag == Command_2Tag.MergeMaturity ? (MergeMaturity)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.MergeMaturity, value); } - - public Disburse? Disburse { get => this.Tag == Command_2Tag.Disburse ? (Disburse)this.Value! : default; set => (this.Tag, this.Value) = (Command_2Tag.Disburse, value); } - - public Command_2(Command_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Command_2() - { - } - } - - public enum Command_2Tag - { - Spawn, - Split, - Configure, - Merge, - DisburseToNeuron, - ClaimOrRefreshNeuron, - MergeMaturity, - Disburse - } -} - -Type File: 'Configure' - -using Test; - -namespace Test -{ - public class Configure - { - public Operation? operation { get; set; } - - public Configure(Operation? operation) - { - this.operation = operation; - } - - public Configure() - { - } - } -} - -Type File: 'Disburse' - -using Test; - -namespace Test -{ - public class Disburse - { - public AccountIdentifier? to_account { get; set; } - - public Amount? amount { get; set; } - - public Disburse(AccountIdentifier? toAccount, Amount? amount) - { - this.to_account = toAccount; - this.amount = amount; - } - - public Disburse() - { - } - } -} - -Type File: 'DisburseResponse' - -namespace Test -{ - public class DisburseResponse - { - public ulong transfer_block_height { get; set; } - - public DisburseResponse(ulong transferBlockHeight) - { - this.transfer_block_height = transferBlockHeight; - } - - public DisburseResponse() - { - } - } -} - -Type File: 'DisburseToNeuron' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class DisburseToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public bool kyc_verified { get; set; } - - public ulong amount_e8s { get; set; } - - public Principal? new_controller { get; set; } - - public ulong nonce { get; set; } - - public DisburseToNeuron(ulong dissolveDelaySeconds, bool kycVerified, ulong amountE8s, Principal? newController, ulong nonce) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.kyc_verified = kycVerified; - this.amount_e8s = amountE8s; - this.new_controller = newController; - this.nonce = nonce; - } - - public DisburseToNeuron() - { - } - } -} - -Type File: 'DissolveState' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class DissolveState - { - [VariantTagProperty()] - public DissolveStateTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public ulong? DissolveDelaySeconds { get => this.Tag == DissolveStateTag.DissolveDelaySeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.DissolveDelaySeconds, value); } - - public ulong? WhenDissolvedTimestampSeconds { get => this.Tag == DissolveStateTag.WhenDissolvedTimestampSeconds ? (ulong)this.Value! : default; set => (this.Tag, this.Value) = (DissolveStateTag.WhenDissolvedTimestampSeconds, value); } - - public DissolveState(DissolveStateTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected DissolveState() - { - } - } - - public enum DissolveStateTag - { - DissolveDelaySeconds, - WhenDissolvedTimestampSeconds - } -} - -Type File: 'ExecuteNnsFunction' - -using System.Collections.Generic; - -namespace Test -{ - public class ExecuteNnsFunction - { - public int nns_function { get; set; } - - public List payload { get; set; } - - public ExecuteNnsFunction(int nnsFunction, List payload) - { - this.nns_function = nnsFunction; - this.payload = payload; - } - - public ExecuteNnsFunction() - { - } - } -} - -Type File: 'Follow' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Follow - { - public int topic { get; set; } - - public List followees { get; set; } - - public Follow(int topic, List followees) - { - this.topic = topic; - this.followees = followees; - } - - public Follow() - { - } - } -} - -Type File: 'Followees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Followees - { - public List followees { get; set; } - - public Followees(List followees) - { - this.followees = followees; - } - - public Followees() - { - } - } -} - -Type File: 'Governance' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class Governance - { - public Dictionary default_followees { get; set; } - - public ulong wait_for_quiet_threshold_seconds { get; set; } - - public GovernanceCachedMetrics? metrics { get; set; } - - public List node_providers { get; set; } - - public NetworkEconomics? economics { get; set; } - - public RewardEvent? latest_reward_event { get; set; } - - public List to_claim_transfers { get; set; } - - public ulong short_voting_period_seconds { get; set; } - - public Dictionary proposals { get; set; } - - public Dictionary in_flight_commands { get; set; } - - public Dictionary neurons { get; set; } - - public ulong genesis_timestamp_seconds { get; set; } - - public Governance(Dictionary defaultFollowees, ulong waitForQuietThresholdSeconds, GovernanceCachedMetrics? metrics, List nodeProviders, NetworkEconomics? economics, RewardEvent? latestRewardEvent, List toClaimTransfers, ulong shortVotingPeriodSeconds, Dictionary proposals, Dictionary inFlightCommands, Dictionary neurons, ulong genesisTimestampSeconds) - { - this.default_followees = defaultFollowees; - this.wait_for_quiet_threshold_seconds = waitForQuietThresholdSeconds; - this.metrics = metrics; - this.node_providers = nodeProviders; - this.economics = economics; - this.latest_reward_event = latestRewardEvent; - this.to_claim_transfers = toClaimTransfers; - this.short_voting_period_seconds = shortVotingPeriodSeconds; - this.proposals = proposals; - this.in_flight_commands = inFlightCommands; - this.neurons = neurons; - this.genesis_timestamp_seconds = genesisTimestampSeconds; - } - - public Governance() - { - } - } -} - -Type File: 'GovernanceCachedMetrics' - -using System.Collections.Generic; - -namespace Test -{ - public class GovernanceCachedMetrics - { - public Dictionary not_dissolving_neurons_e8s_buckets { get; set; } - - public ulong garbage_collectable_neurons_count { get; set; } - - public ulong neurons_with_invalid_stake_count { get; set; } - - public Dictionary not_dissolving_neurons_count_buckets { get; set; } - - public ulong total_supply_icp { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_count { get; set; } - - public ulong dissolved_neurons_count { get; set; } - - public ulong total_staked_e8s { get; set; } - - public ulong not_dissolving_neurons_count { get; set; } - - public ulong dissolved_neurons_e8s { get; set; } - - public ulong neurons_with_less_than_6_months_dissolve_delay_e8s { get; set; } - - public Dictionary dissolving_neurons_count_buckets { get; set; } - - public ulong dissolving_neurons_count { get; set; } - - public Dictionary dissolving_neurons_e8s_buckets { get; set; } - - public ulong community_fund_total_staked_e8s { get; set; } - - public ulong timestamp_seconds { get; set; } - - public GovernanceCachedMetrics(Dictionary notDissolvingNeuronsE8sBuckets, ulong garbageCollectableNeuronsCount, ulong neuronsWithInvalidStakeCount, Dictionary notDissolvingNeuronsCountBuckets, ulong totalSupplyIcp, ulong neuronsWithLessThan6MonthsDissolveDelayCount, ulong dissolvedNeuronsCount, ulong totalStakedE8s, ulong notDissolvingNeuronsCount, ulong dissolvedNeuronsE8s, ulong neuronsWithLessThan6MonthsDissolveDelayE8s, Dictionary dissolvingNeuronsCountBuckets, ulong dissolvingNeuronsCount, Dictionary dissolvingNeuronsE8sBuckets, ulong communityFundTotalStakedE8s, ulong timestampSeconds) - { - this.not_dissolving_neurons_e8s_buckets = notDissolvingNeuronsE8sBuckets; - this.garbage_collectable_neurons_count = garbageCollectableNeuronsCount; - this.neurons_with_invalid_stake_count = neuronsWithInvalidStakeCount; - this.not_dissolving_neurons_count_buckets = notDissolvingNeuronsCountBuckets; - this.total_supply_icp = totalSupplyIcp; - this.neurons_with_less_than_6_months_dissolve_delay_count = neuronsWithLessThan6MonthsDissolveDelayCount; - this.dissolved_neurons_count = dissolvedNeuronsCount; - this.total_staked_e8s = totalStakedE8s; - this.not_dissolving_neurons_count = notDissolvingNeuronsCount; - this.dissolved_neurons_e8s = dissolvedNeuronsE8s; - this.neurons_with_less_than_6_months_dissolve_delay_e8s = neuronsWithLessThan6MonthsDissolveDelayE8s; - this.dissolving_neurons_count_buckets = dissolvingNeuronsCountBuckets; - this.dissolving_neurons_count = dissolvingNeuronsCount; - this.dissolving_neurons_e8s_buckets = dissolvingNeuronsE8sBuckets; - this.community_fund_total_staked_e8s = communityFundTotalStakedE8s; - this.timestamp_seconds = timestampSeconds; - } - - public GovernanceCachedMetrics() - { - } - } -} - -Type File: 'GovernanceError' - -namespace Test -{ - public class GovernanceError - { - public string error_message { get; set; } - - public int error_type { get; set; } - - public GovernanceError(string errorMessage, int errorType) - { - this.error_message = errorMessage; - this.error_type = errorType; - } - - public GovernanceError() - { - } - } -} - -Type File: 'IncreaseDissolveDelay' - -namespace Test -{ - public class IncreaseDissolveDelay - { - public uint additional_dissolve_delay_seconds { get; set; } - - public IncreaseDissolveDelay(uint additionalDissolveDelaySeconds) - { - this.additional_dissolve_delay_seconds = additionalDissolveDelaySeconds; - } - - public IncreaseDissolveDelay() - { - } - } -} - -Type File: 'KnownNeuron' - -using Test; - -namespace Test -{ - public class KnownNeuron - { - public NeuronId? id { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public KnownNeuron(NeuronId? id, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.known_neuron_data = knownNeuronData; - } - - public KnownNeuron() - { - } - } -} - -Type File: 'KnownNeuronData' - -namespace Test -{ - public class KnownNeuronData - { - public string name { get; set; } - - public string? description { get; set; } - - public KnownNeuronData(string name, string? description) - { - this.name = name; - this.description = description; - } - - public KnownNeuronData() - { - } - } -} - -Type File: 'ListKnownNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListKnownNeuronsResponse - { - public List known_neurons { get; set; } - - public ListKnownNeuronsResponse(List knownNeurons) - { - this.known_neurons = knownNeurons; - } - - public ListKnownNeuronsResponse() - { - } - } -} - -Type File: 'ListNeurons' - -using System.Collections.Generic; - -namespace Test -{ - public class ListNeurons - { - public List neuron_ids { get; set; } - - public bool include_neurons_readable_by_caller { get; set; } - - public ListNeurons(List neuronIds, bool includeNeuronsReadableByCaller) - { - this.neuron_ids = neuronIds; - this.include_neurons_readable_by_caller = includeNeuronsReadableByCaller; - } - - public ListNeurons() - { - } - } -} - -Type File: 'ListNeuronsResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNeuronsResponse - { - public Dictionary neuron_infos { get; set; } - - public List full_neurons { get; set; } - - public ListNeuronsResponse(Dictionary neuronInfos, List fullNeurons) - { - this.neuron_infos = neuronInfos; - this.full_neurons = fullNeurons; - } - - public ListNeuronsResponse() - { - } - } -} - -Type File: 'ListNodeProvidersResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListNodeProvidersResponse - { - public List node_providers { get; set; } - - public ListNodeProvidersResponse(List nodeProviders) - { - this.node_providers = nodeProviders; - } - - public ListNodeProvidersResponse() - { - } - } -} - -Type File: 'ListProposalInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfo - { - public List include_reward_status { get; set; } - - public NeuronId? before_proposal { get; set; } - - public uint limit { get; set; } - - public List exclude_topic { get; set; } - - public List include_status { get; set; } - - public ListProposalInfo(List includeRewardStatus, NeuronId? beforeProposal, uint limit, List excludeTopic, List includeStatus) - { - this.include_reward_status = includeRewardStatus; - this.before_proposal = beforeProposal; - this.limit = limit; - this.exclude_topic = excludeTopic; - this.include_status = includeStatus; - } - - public ListProposalInfo() - { - } - } -} - -Type File: 'ListProposalInfoResponse' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class ListProposalInfoResponse - { - public List proposal_info { get; set; } - - public ListProposalInfoResponse(List proposalInfo) - { - this.proposal_info = proposalInfo; - } - - public ListProposalInfoResponse() - { - } - } -} - -Type File: 'MakeProposalResponse' - -using Test; - -namespace Test -{ - public class MakeProposalResponse - { - public NeuronId? proposal_id { get; set; } - - public MakeProposalResponse(NeuronId? proposalId) - { - this.proposal_id = proposalId; - } - - public MakeProposalResponse() - { - } - } -} - -Type File: 'ManageNeuron' - -using Test; - -namespace Test -{ - public class ManageNeuron - { - public NeuronId? id { get; set; } - - public Command? command { get; set; } - - public NeuronIdOrSubaccount? neuron_id_or_subaccount { get; set; } - - public ManageNeuron(NeuronId? id, Command? command, NeuronIdOrSubaccount? neuronIdOrSubaccount) - { - this.id = id; - this.command = command; - this.neuron_id_or_subaccount = neuronIdOrSubaccount; - } - - public ManageNeuron() - { - } - } -} - -Type File: 'ManageNeuronResponse' - -using Test; - -namespace Test -{ - public class ManageNeuronResponse - { - public Command_1? command { get; set; } - - public ManageNeuronResponse(Command_1? command) - { - this.command = command; - } - - public ManageNeuronResponse() - { - } - } -} - -Type File: 'Merge' - -using Test; - -namespace Test -{ - public class Merge - { - public NeuronId? source_neuron_id { get; set; } - - public Merge(NeuronId? sourceNeuronId) - { - this.source_neuron_id = sourceNeuronId; - } - - public Merge() - { - } - } -} - -Type File: 'MergeMaturity' - -namespace Test -{ - public class MergeMaturity - { - public uint percentage_to_merge { get; set; } - - public MergeMaturity(uint percentageToMerge) - { - this.percentage_to_merge = percentageToMerge; - } - - public MergeMaturity() - { - } - } -} - -Type File: 'MergeMaturityResponse' - -namespace Test -{ - public class MergeMaturityResponse - { - public ulong merged_maturity_e8s { get; set; } - - public ulong new_stake_e8s { get; set; } - - public MergeMaturityResponse(ulong mergedMaturityE8s, ulong newStakeE8s) - { - this.merged_maturity_e8s = mergedMaturityE8s; - this.new_stake_e8s = newStakeE8s; - } - - public MergeMaturityResponse() - { - } - } -} - -Type File: 'Motion' - -namespace Test -{ - public class Motion - { - public string motion_text { get; set; } - - public Motion(string motionText) - { - this.motion_text = motionText; - } - - public Motion() - { - } - } -} - -Type File: 'NetworkEconomics' - -namespace Test -{ - public class NetworkEconomics - { - public ulong neuron_minimum_stake_e8s { get; set; } - - public uint max_proposals_to_keep_per_topic { get; set; } - - public ulong neuron_management_fee_per_proposal_e8s { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public ulong transaction_fee_e8s { get; set; } - - public ulong neuron_spawn_dissolve_delay_seconds { get; set; } - - public ulong minimum_icp_xdr_rate { get; set; } - - public ulong maximum_node_provider_rewards_e8s { get; set; } - - public NetworkEconomics(ulong neuronMinimumStakeE8s, uint maxProposalsToKeepPerTopic, ulong neuronManagementFeePerProposalE8s, ulong rejectCostE8s, ulong transactionFeeE8s, ulong neuronSpawnDissolveDelaySeconds, ulong minimumIcpXdrRate, ulong maximumNodeProviderRewardsE8s) - { - this.neuron_minimum_stake_e8s = neuronMinimumStakeE8s; - this.max_proposals_to_keep_per_topic = maxProposalsToKeepPerTopic; - this.neuron_management_fee_per_proposal_e8s = neuronManagementFeePerProposalE8s; - this.reject_cost_e8s = rejectCostE8s; - this.transaction_fee_e8s = transactionFeeE8s; - this.neuron_spawn_dissolve_delay_seconds = neuronSpawnDissolveDelaySeconds; - this.minimum_icp_xdr_rate = minimumIcpXdrRate; - this.maximum_node_provider_rewards_e8s = maximumNodeProviderRewardsE8s; - } - - public NetworkEconomics() - { - } - } -} - -Type File: 'Neuron' - -using Test; -using EdjCase.ICP.Candid.Models; -using System.Collections.Generic; - -namespace Test -{ - public class Neuron - { - public NeuronId? id { get; set; } - - public Principal? controller { get; set; } - - public List recent_ballots { get; set; } - - public bool kyc_verified { get; set; } - - public bool not_for_profit { get; set; } - - public ulong maturity_e8s_equivalent { get; set; } - - public ulong cached_neuron_stake_e8s { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public ulong aging_since_timestamp_seconds { get; set; } - - public List hot_keys { get; set; } - - public List account { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public DissolveState? dissolve_state { get; set; } - - public Dictionary followees { get; set; } - - public ulong neuron_fees_e8s { get; set; } - - public NeuronStakeTransfer? transfer { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public Neuron(NeuronId? id, Principal? controller, List recentBallots, bool kycVerified, bool notForProfit, ulong maturityE8sEquivalent, ulong cachedNeuronStakeE8s, ulong createdTimestampSeconds, ulong agingSinceTimestampSeconds, List hotKeys, List account, ulong? joinedCommunityFundTimestampSeconds, DissolveState? dissolveState, Dictionary followees, ulong neuronFeesE8s, NeuronStakeTransfer? transfer, KnownNeuronData? knownNeuronData) - { - this.id = id; - this.controller = controller; - this.recent_ballots = recentBallots; - this.kyc_verified = kycVerified; - this.not_for_profit = notForProfit; - this.maturity_e8s_equivalent = maturityE8sEquivalent; - this.cached_neuron_stake_e8s = cachedNeuronStakeE8s; - this.created_timestamp_seconds = createdTimestampSeconds; - this.aging_since_timestamp_seconds = agingSinceTimestampSeconds; - this.hot_keys = hotKeys; - this.account = account; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.dissolve_state = dissolveState; - this.followees = followees; - this.neuron_fees_e8s = neuronFeesE8s; - this.transfer = transfer; - this.known_neuron_data = knownNeuronData; - } - - public Neuron() - { - } - } -} - -Type File: 'NeuronId' - -namespace Test -{ - public class NeuronId - { - public ulong id { get; set; } - - public NeuronId(ulong id) - { - this.id = id; - } - - public NeuronId() - { - } - } -} - -Type File: 'NeuronIdOrSubaccount' - -using EdjCase.ICP.Candid.Mapping; -using Test; -using System.Collections.Generic; - -namespace Test -{ - [Variant()] - public class NeuronIdOrSubaccount - { - [VariantTagProperty()] - public NeuronIdOrSubaccountTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public List? Subaccount { get => this.Tag == NeuronIdOrSubaccountTag.Subaccount ? (List)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.Subaccount, value); } - - public NeuronId? NeuronId { get => this.Tag == NeuronIdOrSubaccountTag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (NeuronIdOrSubaccountTag.NeuronId, value); } - - public NeuronIdOrSubaccount(NeuronIdOrSubaccountTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected NeuronIdOrSubaccount() - { - } - } - - public enum NeuronIdOrSubaccountTag - { - Subaccount, - NeuronId - } -} - -Type File: 'NeuronInFlightCommand' - -using Test; - -namespace Test -{ - public class NeuronInFlightCommand - { - public Command_2? command { get; set; } - - public ulong timestamp { get; set; } - - public NeuronInFlightCommand(Command_2? command, ulong timestamp) - { - this.command = command; - this.timestamp = timestamp; - } - - public NeuronInFlightCommand() - { - } - } -} - -Type File: 'NeuronInfo' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class NeuronInfo - { - public ulong dissolve_delay_seconds { get; set; } - - public List recent_ballots { get; set; } - - public ulong created_timestamp_seconds { get; set; } - - public int state { get; set; } - - public ulong stake_e8s { get; set; } - - public ulong? joined_community_fund_timestamp_seconds { get; set; } - - public ulong retrieved_at_timestamp_seconds { get; set; } - - public KnownNeuronData? known_neuron_data { get; set; } - - public ulong voting_power { get; set; } - - public ulong age_seconds { get; set; } - - public NeuronInfo(ulong dissolveDelaySeconds, List recentBallots, ulong createdTimestampSeconds, int state, ulong stakeE8s, ulong? joinedCommunityFundTimestampSeconds, ulong retrievedAtTimestampSeconds, KnownNeuronData? knownNeuronData, ulong votingPower, ulong ageSeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - this.recent_ballots = recentBallots; - this.created_timestamp_seconds = createdTimestampSeconds; - this.state = state; - this.stake_e8s = stakeE8s; - this.joined_community_fund_timestamp_seconds = joinedCommunityFundTimestampSeconds; - this.retrieved_at_timestamp_seconds = retrievedAtTimestampSeconds; - this.known_neuron_data = knownNeuronData; - this.voting_power = votingPower; - this.age_seconds = ageSeconds; - } - - public NeuronInfo() - { - } - } -} - -Type File: 'NeuronStakeTransfer' - -using System.Collections.Generic; -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class NeuronStakeTransfer - { - public List to_subaccount { get; set; } - - public ulong neuron_stake_e8s { get; set; } - - public Principal? from { get; set; } - - public ulong memo { get; set; } - - public List from_subaccount { get; set; } - - public ulong transfer_timestamp { get; set; } - - public ulong block_height { get; set; } - - public NeuronStakeTransfer(List toSubaccount, ulong neuronStakeE8s, Principal? from, ulong memo, List fromSubaccount, ulong transferTimestamp, ulong blockHeight) - { - this.to_subaccount = toSubaccount; - this.neuron_stake_e8s = neuronStakeE8s; - this.from = from; - this.memo = memo; - this.from_subaccount = fromSubaccount; - this.transfer_timestamp = transferTimestamp; - this.block_height = blockHeight; - } - - public NeuronStakeTransfer() - { - } - } -} - -Type File: 'NodeProvider' - -using EdjCase.ICP.Candid.Models; -using Test; - -namespace Test -{ - public class NodeProvider - { - public Principal? id { get; set; } - - public AccountIdentifier? reward_account { get; set; } - - public NodeProvider(Principal? id, AccountIdentifier? rewardAccount) - { - this.id = id; - this.reward_account = rewardAccount; - } - - public NodeProvider() - { - } - } -} - -Type File: 'Operation' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Operation - { - [VariantTagProperty()] - public OperationTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RemoveHotKey? RemoveHotKey { get => this.Tag == OperationTag.RemoveHotKey ? (RemoveHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.RemoveHotKey, value); } - - public AddHotKey? AddHotKey { get => this.Tag == OperationTag.AddHotKey ? (AddHotKey)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.AddHotKey, value); } - - public Operation.StopDissolvingInfo? StopDissolving { get => this.Tag == OperationTag.StopDissolving ? (Operation.StopDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StopDissolving, value); } - - public Operation.StartDissolvingInfo? StartDissolving { get => this.Tag == OperationTag.StartDissolving ? (Operation.StartDissolvingInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.StartDissolving, value); } - - public IncreaseDissolveDelay? IncreaseDissolveDelay { get => this.Tag == OperationTag.IncreaseDissolveDelay ? (IncreaseDissolveDelay)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.IncreaseDissolveDelay, value); } - - public Operation.JoinCommunityFundInfo? JoinCommunityFund { get => this.Tag == OperationTag.JoinCommunityFund ? (Operation.JoinCommunityFundInfo)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.JoinCommunityFund, value); } - - public SetDissolveTimestamp? SetDissolveTimestamp { get => this.Tag == OperationTag.SetDissolveTimestamp ? (SetDissolveTimestamp)this.Value! : default; set => (this.Tag, this.Value) = (OperationTag.SetDissolveTimestamp, value); } - - public Operation(OperationTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Operation() - { - } - - public class StopDissolvingInfo - { - public StopDissolvingInfo() - { - } - } - - public class StartDissolvingInfo - { - public StartDissolvingInfo() - { - } - } - - public class JoinCommunityFundInfo - { - public JoinCommunityFundInfo() - { - } - } - } - - public enum OperationTag - { - RemoveHotKey, - AddHotKey, - StopDissolving, - StartDissolving, - IncreaseDissolveDelay, - JoinCommunityFund, - SetDissolveTimestamp - } -} - -Type File: 'Proposal' - -using Test; - -namespace Test -{ - public class Proposal - { - public string url { get; set; } - - public string? title { get; set; } - - public Action? action { get; set; } - - public string summary { get; set; } - - public Proposal(string url, string? title, Action? action, string summary) - { - this.url = url; - this.title = title; - this.action = action; - this.summary = summary; - } - - public Proposal() - { - } - } -} - -Type File: 'ProposalData' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalData - { - public NeuronId? id { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public WaitForQuietState? wait_for_quiet_state { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalData(NeuronId? id, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, WaitForQuietState? waitForQuietState, ulong executedTimestampSeconds) - { - this.id = id; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.wait_for_quiet_state = waitForQuietState; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalData() - { - } - } -} - -Type File: 'ProposalInfo' - -using Test; -using System.Collections.Generic; - -namespace Test -{ - public class ProposalInfo - { - public NeuronId? id { get; set; } - - public int status { get; set; } - - public int topic { get; set; } - - public GovernanceError? failure_reason { get; set; } - - public Dictionary ballots { get; set; } - - public ulong proposal_timestamp_seconds { get; set; } - - public ulong reward_event_round { get; set; } - - public ulong? deadline_timestamp_seconds { get; set; } - - public ulong failed_timestamp_seconds { get; set; } - - public ulong reject_cost_e8s { get; set; } - - public Tally? latest_tally { get; set; } - - public int reward_status { get; set; } - - public ulong decided_timestamp_seconds { get; set; } - - public Proposal? proposal { get; set; } - - public NeuronId? proposer { get; set; } - - public ulong executed_timestamp_seconds { get; set; } - - public ProposalInfo(NeuronId? id, int status, int topic, GovernanceError? failureReason, Dictionary ballots, ulong proposalTimestampSeconds, ulong rewardEventRound, ulong? deadlineTimestampSeconds, ulong failedTimestampSeconds, ulong rejectCostE8s, Tally? latestTally, int rewardStatus, ulong decidedTimestampSeconds, Proposal? proposal, NeuronId? proposer, ulong executedTimestampSeconds) - { - this.id = id; - this.status = status; - this.topic = topic; - this.failure_reason = failureReason; - this.ballots = ballots; - this.proposal_timestamp_seconds = proposalTimestampSeconds; - this.reward_event_round = rewardEventRound; - this.deadline_timestamp_seconds = deadlineTimestampSeconds; - this.failed_timestamp_seconds = failedTimestampSeconds; - this.reject_cost_e8s = rejectCostE8s; - this.latest_tally = latestTally; - this.reward_status = rewardStatus; - this.decided_timestamp_seconds = decidedTimestampSeconds; - this.proposal = proposal; - this.proposer = proposer; - this.executed_timestamp_seconds = executedTimestampSeconds; - } - - public ProposalInfo() - { - } - } -} - -Type File: 'RegisterVote' - -using Test; - -namespace Test -{ - public class RegisterVote - { - public int vote { get; set; } - - public NeuronId? proposal { get; set; } - - public RegisterVote(int vote, NeuronId? proposal) - { - this.vote = vote; - this.proposal = proposal; - } - - public RegisterVote() - { - } - } -} - -Type File: 'RemoveHotKey' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class RemoveHotKey - { - public Principal? hot_key_to_remove { get; set; } - - public RemoveHotKey(Principal? hotKeyToRemove) - { - this.hot_key_to_remove = hotKeyToRemove; - } - - public RemoveHotKey() - { - } - } -} - -Type File: 'Result' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result - { - [VariantTagProperty()] - public ResultTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Err { get => this.Tag == ResultTag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (ResultTag.Err, value); } - - public Result(ResultTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result() - { - } - } - - public enum ResultTag - { - Ok, - Err - } -} - -Type File: 'Result_1' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_1 - { - [VariantTagProperty()] - public Result_1Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public GovernanceError? Error { get => this.Tag == Result_1Tag.Error ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.Error, value); } - - public NeuronId? NeuronId { get => this.Tag == Result_1Tag.NeuronId ? (NeuronId)this.Value! : default; set => (this.Tag, this.Value) = (Result_1Tag.NeuronId, value); } - - public Result_1(Result_1Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_1() - { - } - } - - public enum Result_1Tag - { - Error, - NeuronId - } -} - -Type File: 'Result_2' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_2 - { - [VariantTagProperty()] - public Result_2Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public Neuron? Ok { get => this.Tag == Result_2Tag.Ok ? (Neuron)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_2Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_2Tag.Err, value); } - - public Result_2(Result_2Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_2() - { - } - } - - public enum Result_2Tag - { - Ok, - Err - } -} - -Type File: 'Result_3' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_3 - { - [VariantTagProperty()] - public Result_3Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardNodeProviders? Ok { get => this.Tag == Result_3Tag.Ok ? (RewardNodeProviders)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_3Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_3Tag.Err, value); } - - public Result_3(Result_3Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_3() - { - } - } - - public enum Result_3Tag - { - Ok, - Err - } -} - -Type File: 'Result_4' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_4 - { - [VariantTagProperty()] - public Result_4Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NeuronInfo? Ok { get => this.Tag == Result_4Tag.Ok ? (NeuronInfo)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_4Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_4Tag.Err, value); } - - public Result_4(Result_4Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_4() - { - } - } - - public enum Result_4Tag - { - Ok, - Err - } -} - -Type File: 'Result_5' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class Result_5 - { - [VariantTagProperty()] - public Result_5Tag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public NodeProvider? Ok { get => this.Tag == Result_5Tag.Ok ? (NodeProvider)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Ok, value); } - - public GovernanceError? Err { get => this.Tag == Result_5Tag.Err ? (GovernanceError)this.Value! : default; set => (this.Tag, this.Value) = (Result_5Tag.Err, value); } - - public Result_5(Result_5Tag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected Result_5() - { - } - } - - public enum Result_5Tag - { - Ok, - Err - } -} - -Type File: 'RewardEvent' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardEvent - { - public ulong day_after_genesis { get; set; } - - public ulong actual_timestamp_seconds { get; set; } - - public ulong distributed_e8s_equivalent { get; set; } - - public List settled_proposals { get; set; } - - public RewardEvent(ulong dayAfterGenesis, ulong actualTimestampSeconds, ulong distributedE8sEquivalent, List settledProposals) - { - this.day_after_genesis = dayAfterGenesis; - this.actual_timestamp_seconds = actualTimestampSeconds; - this.distributed_e8s_equivalent = distributedE8sEquivalent; - this.settled_proposals = settledProposals; - } - - public RewardEvent() - { - } - } -} - -Type File: 'RewardMode' - -using EdjCase.ICP.Candid.Mapping; -using Test; - -namespace Test -{ - [Variant()] - public class RewardMode - { - [VariantTagProperty()] - public RewardModeTag Tag { get; set; } - - [VariantValueProperty()] - public object? Value { get; set; } - - public RewardToNeuron? RewardToNeuron { get => this.Tag == RewardModeTag.RewardToNeuron ? (RewardToNeuron)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToNeuron, value); } - - public RewardToAccount? RewardToAccount { get => this.Tag == RewardModeTag.RewardToAccount ? (RewardToAccount)this.Value! : default; set => (this.Tag, this.Value) = (RewardModeTag.RewardToAccount, value); } - - public RewardMode(RewardModeTag tag, object? value) - { - this.Tag = tag; - this.Value = value; - } - - protected RewardMode() - { - } - } - - public enum RewardModeTag - { - RewardToNeuron, - RewardToAccount - } -} - -Type File: 'RewardNodeProvider' - -using Test; - -namespace Test -{ - public class RewardNodeProvider - { - public NodeProvider? node_provider { get; set; } - - public RewardMode? reward_mode { get; set; } - - public ulong amount_e8s { get; set; } - - public RewardNodeProvider(NodeProvider? nodeProvider, RewardMode? rewardMode, ulong amountE8s) - { - this.node_provider = nodeProvider; - this.reward_mode = rewardMode; - this.amount_e8s = amountE8s; - } - - public RewardNodeProvider() - { - } - } -} - -Type File: 'RewardNodeProviders' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class RewardNodeProviders - { - public bool? use_registry_derived_rewards { get; set; } - - public List rewards { get; set; } - - public RewardNodeProviders(bool? useRegistryDerivedRewards, List rewards) - { - this.use_registry_derived_rewards = useRegistryDerivedRewards; - this.rewards = rewards; - } - - public RewardNodeProviders() - { - } - } -} - -Type File: 'RewardToAccount' - -using Test; - -namespace Test -{ - public class RewardToAccount - { - public AccountIdentifier? to_account { get; set; } - - public RewardToAccount(AccountIdentifier? toAccount) - { - this.to_account = toAccount; - } - - public RewardToAccount() - { - } - } -} - -Type File: 'RewardToNeuron' - -namespace Test -{ - public class RewardToNeuron - { - public ulong dissolve_delay_seconds { get; set; } - - public RewardToNeuron(ulong dissolveDelaySeconds) - { - this.dissolve_delay_seconds = dissolveDelaySeconds; - } - - public RewardToNeuron() - { - } - } -} - -Type File: 'SetDefaultFollowees' - -using System.Collections.Generic; -using Test; - -namespace Test -{ - public class SetDefaultFollowees - { - public Dictionary default_followees { get; set; } - - public SetDefaultFollowees(Dictionary defaultFollowees) - { - this.default_followees = defaultFollowees; - } - - public SetDefaultFollowees() - { - } - } -} - -Type File: 'SetDissolveTimestamp' - -namespace Test -{ - public class SetDissolveTimestamp - { - public ulong dissolve_timestamp_seconds { get; set; } - - public SetDissolveTimestamp(ulong dissolveTimestampSeconds) - { - this.dissolve_timestamp_seconds = dissolveTimestampSeconds; - } - - public SetDissolveTimestamp() - { - } - } -} - -Type File: 'Spawn' - -using EdjCase.ICP.Candid.Models; - -namespace Test -{ - public class Spawn - { - public uint? percentage_to_spawn { get; set; } - - public Principal? new_controller { get; set; } - - public ulong? nonce { get; set; } - - public Spawn(uint? percentageToSpawn, Principal? newController, ulong? nonce) - { - this.percentage_to_spawn = percentageToSpawn; - this.new_controller = newController; - this.nonce = nonce; - } - - public Spawn() - { - } - } -} - -Type File: 'SpawnResponse' - -using Test; - -namespace Test -{ - public class SpawnResponse - { - public NeuronId? created_neuron_id { get; set; } - - public SpawnResponse(NeuronId? createdNeuronId) - { - this.created_neuron_id = createdNeuronId; - } - - public SpawnResponse() - { - } - } -} - -Type File: 'Split' - -namespace Test -{ - public class Split - { - public ulong amount_e8s { get; set; } - - public Split(ulong amountE8s) - { - this.amount_e8s = amountE8s; - } - - public Split() - { - } - } -} - -Type File: 'Tally' - -namespace Test -{ - public class Tally - { - public ulong no { get; set; } - - public ulong yes { get; set; } - - public ulong total { get; set; } - - public ulong timestamp_seconds { get; set; } - - public Tally(ulong no, ulong yes, ulong total, ulong timestampSeconds) - { - this.no = no; - this.yes = yes; - this.total = total; - this.timestamp_seconds = timestampSeconds; - } - - public Tally() - { - } - } -} - -Type File: 'UpdateNodeProvider' - -using Test; - -namespace Test -{ - public class UpdateNodeProvider - { - public AccountIdentifier? reward_account { get; set; } - - public UpdateNodeProvider(AccountIdentifier? rewardAccount) - { - this.reward_account = rewardAccount; - } - - public UpdateNodeProvider() - { - } - } -} - -Type File: 'WaitForQuietState' - -namespace Test -{ - public class WaitForQuietState - { - public ulong current_deadline_timestamp_seconds { get; set; } - - public WaitForQuietState(ulong currentDeadlineTimestampSeconds) - { - this.current_deadline_timestamp_seconds = currentDeadlineTimestampSeconds; - } - - public WaitForQuietState() - { - } - } -}