using System;
#if WASM
   using CommonHelpers.WASM;
   using BookRegistry.Client.DB;
namespace BookRegistry.Client {
#else // !WASM:
   using CommonHelpers;
   using BookRegistry.Server.DB;
namespace BookRegistry.Server {
#endif // !WASM
//==================================================================================================

public class RefreshTokens_Response: GeneralApiResponse
{
   public GeneratedToken_Info AccessToken {
      get => Get( NAccessToken );
      set => NAccessToken = value; } internal GeneratedToken_Info? NAccessToken;

   public GeneratedToken_Info? RefreshToken { get; set; }

   public RefreshTokens_Response() {}
   public RefreshTokens_Response(GeneralApiResponse simpleResponse)
   : base( simpleResponse ) {}
#if SERVER
   internal RefreshTokens_Response( string userName, string roleName, bool generateBothTokens )
   {
      AccessToken = new GeneratedToken_Info( userName, roleName );
      if ( generateBothTokens )
         RefreshToken = new GeneratedToken_Info( userName, roleName, true );
   }
#endif // SERVER
} // RefreshTokens_Response

//==================================================================================================

public class RefreshTokens_Args: ApiArgumentsBase
{
   public bool GenerateBothTokens {
      get => Value( NGenerateBothTokens );
      set => NGenerateBothTokens = value; } internal bool? NGenerateBothTokens;
} // RefreshTokens_Args

//==================================================================================================
} // BookRegistry.Client/Server
