-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in release/0.1.1 (pull request #2)
Release/0.1.1
- Loading branch information
Showing
12 changed files
with
321 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Libraries/CloseIoDotNet/Entities/Definitions/IEntityScannable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
namespace CloseIoDotNet.Entities.Definitions | ||
{ | ||
using System.Collections.Generic; | ||
using CloseIoDotNet.Entities.Enumerations; | ||
using Fields; | ||
|
||
public interface IEntityScannable : IEntity | ||
{ | ||
IEnumerable<IEntityField> ScannableFields { get; } | ||
IEnumerable<ScanType> ScanTypesSupported { get; } | ||
string GenerateScanResource(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace CloseIoDotNet.Entities.Enumerations | ||
{ | ||
public enum ScanType | ||
{ | ||
Base = 0, | ||
Fields, | ||
Query | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
Libraries/CloseIoDotNet/Rest/Exceptions/CloseIoRequestException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
namespace CloseIoDotNet.Rest.Exceptions | ||
{ | ||
using System; | ||
using System.Net; | ||
using RestSharp; | ||
|
||
public class CloseIoRequestException : Exception | ||
{ | ||
#region Constants | ||
private const string DefaultMessage = | ||
"Close.Io returned an unknown error to your request"; | ||
#endregion | ||
|
||
#region Instance Variables | ||
private HttpStatusCode? _statusCode; | ||
private string _body; | ||
#endregion | ||
|
||
#region Properties | ||
public IRestRequest RestRequest { get; set; } | ||
public IRestResponse RestResponse { get; set; } | ||
public HttpStatusCode ResponseStatusCode | ||
{ | ||
get | ||
{ | ||
if (_statusCode.HasValue == false) | ||
{ | ||
try | ||
{ | ||
_statusCode = RestResponse.StatusCode; | ||
} | ||
catch (Exception) | ||
{ | ||
_statusCode = new HttpStatusCode(); | ||
} | ||
} | ||
return _statusCode.Value; | ||
} | ||
set { _statusCode = value; } | ||
} | ||
public string ResponseBody | ||
{ | ||
get | ||
{ | ||
if (_body == null) | ||
{ | ||
try | ||
{ | ||
_body = RestResponse.Content; | ||
} | ||
catch (Exception) | ||
{ | ||
_body = string.Empty; | ||
} | ||
} | ||
return _body; | ||
} | ||
set { _body = value; } | ||
} | ||
|
||
#endregion | ||
|
||
#region Constructors | ||
public CloseIoRequestException() : base(DefaultMessage) { } | ||
|
||
public CloseIoRequestException(string message) : base(message) { } | ||
|
||
public CloseIoRequestException(string message, Exception innerException) : base(message, innerException) { } | ||
#endregion | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
Libraries/CloseIoDotNet/Rest/Exceptions/InternalServerErrorException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
namespace CloseIoDotNet.Rest.Exceptions | ||
{ | ||
using System; | ||
public class InternalServerErrorException : Exception | ||
{ | ||
#region Constants | ||
public const string DefaultMessage = | ||
"Close.Io encountered an unexpected internal server error (HTTP 500) while processing your request."; | ||
#endregion | ||
|
||
#region Constructors | ||
public InternalServerErrorException() : base(DefaultMessage) { } | ||
|
||
public InternalServerErrorException(string message) : base(message) { } | ||
|
||
public InternalServerErrorException(string message, Exception innerException) : base(message, innerException) { } | ||
#endregion | ||
} | ||
} |
Oops, something went wrong.