init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class FileDeleteFailureResponse
|
||||
{
|
||||
[JsonProperty("uzenet")]
|
||||
public string Uzenet { get; set; }
|
||||
|
||||
[JsonProperty("hibaAzonosito")]
|
||||
public Guid HibaAzonosito { get; set; }
|
||||
|
||||
[JsonProperty("datumUtc")]
|
||||
public DateTime DatumUtc { get; set; }
|
||||
|
||||
[JsonProperty("megnevezes")]
|
||||
public string Megnevezes { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class FileDeleteResponse : IResponse
|
||||
{
|
||||
public FileDeleteResponse()
|
||||
{
|
||||
IsSuccess = true;
|
||||
}
|
||||
|
||||
public FileDeleteResponse(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public FileDeleteResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class FileDeleteResponseV3 : IResponse
|
||||
{
|
||||
public FileDeleteResponseV3()
|
||||
{
|
||||
}
|
||||
|
||||
public FileDeleteResponseV3(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public FileDeleteResponseV3(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
IsSuccess = false;
|
||||
}
|
||||
|
||||
[JsonProperty("fajlId")]
|
||||
public Guid FileId { get; set; }
|
||||
|
||||
[JsonProperty("sikeres")]
|
||||
public bool IsSuccess { get; set; }
|
||||
|
||||
[JsonProperty("hibaUzenet")]
|
||||
public string ErrorMessage { get; set; }
|
||||
|
||||
[JsonProperty("hiba")]
|
||||
public string Error { get; set; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class FileFinalizeResponse : IResponse
|
||||
{
|
||||
public FileFinalizeResponse()
|
||||
{
|
||||
IsSuccess = true;
|
||||
}
|
||||
|
||||
public FileFinalizeResponse(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public FileFinalizeResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class FileFinalizeResponseV3 : IResponse
|
||||
{
|
||||
|
||||
public FileFinalizeResponseV3()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public FileFinalizeResponseV3(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public FileFinalizeResponseV3(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public FileFinalizeResponseV3(Guid fajlId, bool isSuccess, string error, bool tryAgain, HttpStatusCode statusCode, string errorMessage, Exception exception) : this(isSuccess)
|
||||
{
|
||||
FajlAzonosito = fajlId;
|
||||
Error = error;
|
||||
TryAgain = tryAgain;
|
||||
StatusCode = statusCode;
|
||||
ErrorMessage = errorMessage;
|
||||
Exception = exception;
|
||||
}
|
||||
|
||||
public Guid FajlAzonosito { get; }
|
||||
|
||||
public bool IsSuccess { get; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
public HttpStatusCode StatusCode { get; }
|
||||
public string ErrorMessage { get; }
|
||||
public Exception Exception { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.FileService.Response.FileFinalize
|
||||
{
|
||||
public class FinalizedFileDtoV3
|
||||
{
|
||||
public Guid FajlId { get; set; }
|
||||
|
||||
public string HibaSzoveg { get; set; }
|
||||
|
||||
public bool IsSikeres { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
using System.Collections.Generic;
|
||||
using Kreta.Client.FileService.Model;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class InternalFileFinalizeResponse
|
||||
{
|
||||
[JsonProperty("fajlok")]
|
||||
public List<FileDataWithError> Fajlok { get; set; }
|
||||
|
||||
[JsonProperty("hibaSzoveg")]
|
||||
public string HibaSzoveg { get; set; }
|
||||
|
||||
[JsonProperty("isSikeres")]
|
||||
public bool IsSikeres { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class FileUploadFailureResponse
|
||||
{
|
||||
[JsonProperty("uzenet")]
|
||||
public string Uzenet { get; set; }
|
||||
|
||||
[JsonProperty("hibaAzonosito")]
|
||||
public Guid HibaAzonosito { get; set; }
|
||||
|
||||
[JsonProperty("datumUtc")]
|
||||
public DateTime DatumUtc { get; set; }
|
||||
|
||||
[JsonProperty("megnevezes")]
|
||||
public string Megnevezes { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class FileUploadResponse : IResponse
|
||||
{
|
||||
public FileUploadResponse() { }
|
||||
|
||||
public FileUploadResponse(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public FileUploadResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public FileUploadResponse(Guid fajlAzonosito, string utvonal, int fajlMeretByteLength)
|
||||
{
|
||||
if (fajlAzonosito == Guid.Empty)
|
||||
{
|
||||
throw new ArgumentException(nameof(fajlAzonosito));
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(utvonal))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(utvonal));
|
||||
}
|
||||
|
||||
if (fajlMeretByteLength < 1)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(fajlMeretByteLength));
|
||||
}
|
||||
|
||||
IsSuccess = true;
|
||||
FajlAzonosito = fajlAzonosito;
|
||||
Utvonal = utvonal;
|
||||
FajlMeretByteLength = fajlMeretByteLength;
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; }
|
||||
|
||||
public Guid FajlAzonosito { get; }
|
||||
|
||||
public string Utvonal { get; }
|
||||
|
||||
public int FajlMeretByteLength;
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class FileUploadSuccessResponse
|
||||
{
|
||||
[JsonProperty(PropertyName = "fajlId")]
|
||||
private Guid FajlAzonositoV3 { set { FajlAzonosito = value; } }
|
||||
|
||||
[JsonProperty(PropertyName = "fajlAzonosito")]
|
||||
public Guid FajlAzonosito { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "utvonal")]
|
||||
public string Utvonal { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "fajlMeretByteLength")]
|
||||
public int FajlMeretByteLength { get; set; }
|
||||
}
|
||||
}
|
37
Kreta.Client/FileService/Response/GetFile/GetFileResponse.cs
Normal file
37
Kreta.Client/FileService/Response/GetFile/GetFileResponse.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class GetFileResponse : IResponse
|
||||
{
|
||||
public GetFileResponse() { }
|
||||
|
||||
public GetFileResponse(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public GetFileResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; private set; }
|
||||
|
||||
[JsonProperty("fajlId")]
|
||||
public Guid FajlId { get; set; }
|
||||
|
||||
[JsonProperty("tartalom")]
|
||||
public string Tartalom { get; set; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class GetTokenFailureResponse
|
||||
{
|
||||
[JsonProperty("error")]
|
||||
public string Error { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class GetTokenResponse : IResponse
|
||||
{
|
||||
public GetTokenResponse() { }
|
||||
|
||||
public GetTokenResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
public GetTokenResponse(string accessToken, int expiresIn)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(accessToken))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(accessToken));
|
||||
}
|
||||
|
||||
if (expiresIn < 1)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(expiresIn));
|
||||
}
|
||||
|
||||
IsSuccess = true;
|
||||
AccessToken = accessToken;
|
||||
ExpiresIn = expiresIn;
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; }
|
||||
|
||||
public string AccessToken { get; }
|
||||
|
||||
public int ExpiresIn { get; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class GetTokenSuccessResponse
|
||||
{
|
||||
[JsonProperty(PropertyName = "access_token")]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "expires_in")]
|
||||
public int ExpiresIn { get; set; }
|
||||
|
||||
[JsonProperty(PropertyName = "token_type")]
|
||||
public string TokenType { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal class GetUrlFailureResponse
|
||||
{
|
||||
[JsonProperty("uzenet")]
|
||||
public string Uzenet { get; set; }
|
||||
|
||||
[JsonProperty("hibaAzonosito")]
|
||||
public Guid HibaAzonosito { get; set; }
|
||||
|
||||
[JsonProperty("datumUtc")]
|
||||
public DateTime DatumUtc { get; set; }
|
||||
|
||||
[JsonProperty("megnevezes")]
|
||||
public string Megnevezes { get; set; }
|
||||
}
|
||||
}
|
46
Kreta.Client/FileService/Response/GetUrl/GetUrlResponse.cs
Normal file
46
Kreta.Client/FileService/Response/GetUrl/GetUrlResponse.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
|
||||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
public class GetUrlResponse : IResponse
|
||||
{
|
||||
public GetUrlResponse() { }
|
||||
|
||||
public GetUrlResponse(bool tryAgain)
|
||||
{
|
||||
TryAgain = tryAgain;
|
||||
}
|
||||
|
||||
public GetUrlResponse(string error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(error))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(error));
|
||||
}
|
||||
|
||||
Error = error;
|
||||
}
|
||||
|
||||
internal static GetUrlResponse GetUrlResponseWithUrl(string url)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(url))
|
||||
{
|
||||
throw new ArgumentNullException(nameof(url));
|
||||
}
|
||||
|
||||
return new GetUrlResponse
|
||||
{
|
||||
IsSuccess = true,
|
||||
Url = url,
|
||||
};
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; private set; }
|
||||
|
||||
public string Url { get; private set; }
|
||||
|
||||
public string Error { get; }
|
||||
|
||||
public bool TryAgain { get; }
|
||||
}
|
||||
}
|
11
Kreta.Client/FileService/Response/IResponse.cs
Normal file
11
Kreta.Client/FileService/Response/IResponse.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
namespace Kreta.Client.FileService.Response
|
||||
{
|
||||
internal interface IResponse
|
||||
{
|
||||
bool IsSuccess { get; }
|
||||
|
||||
string Error { get; }
|
||||
|
||||
bool TryAgain { get; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue