Untitled

mail@pastecode.io avatar
unknown
csharp
2 years ago
1.0 kB
2
Indexable
Never
// 200 OK Response body
public class OkResponse
{
    [JsonPropertyName("message")]
    public string Message { get; set; }

    [JsonPropertyName("source")]
    public string Source { get; set; }
    
    [JsonPropertyName("fileName")]
    public string FileName { get; set; }

    [JsonPropertyName("fileId")]
    public string? FileId { get; set; }
}

// 400 BadRequest Response body
public class ErrorResponse
{
    [JsonPropertyName("errorSource")]
    public string ErrorSource { get; set; }
    
    [JsonPropertyName("errorMessage")]
    public string ErrorMessage { get; set; }
    
    [JsonPropertyName("spotContainer")] 
    public string SpotContainer { get; set; }
    
    [JsonPropertyName("source")]
    public string Source { get; set; }
    
    [JsonPropertyName("fileName")]
    public string FileName { get; set; }
}

// Possible reasons for failure
public enum ErrorSource
{
    Validation,
    SpotUpload,
    ImageGridFileUpload,
    ImageGridMetadataUpload,
    Unknown
}