/* * Copyright (c) 2024 ETH Zürich, IT Services * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ namespace SafeExamBrowser.Server.Contracts.Data { /// /// Defines the result of a communication with a SEB server. /// public class ServerResponse { /// /// The message retrieved by the server in case the communication failed. /// public string Message { get; } /// /// Defines whether the communication was successful or not. /// public bool Success { get; } public ServerResponse(bool success, string message = default) { Message = message; Success = success; } } /// /// Defines the result of a communication with a SEB server. /// /// The type of the expected response value. public class ServerResponse : ServerResponse { /// /// The response value. Can be null or default(T) in case the communication failed! /// public T Value { get; } public ServerResponse(bool success, T value, string message = default) : base(success, message) { Value = value; } } }