Beispiel #1
0
 public PolyListAssetsResult(PolyStatus status, int totalSize = 0, List <PolyAsset> assets = null,
                             string nextPageToken             = null)
 {
     this.status        = status;
     this.assets        = assets;
     this.totalSize     = totalSize;
     this.nextPageToken = nextPageToken;
 }
Beispiel #2
0
 /// <summary>
 /// Creates a PolyStatusOr with the given error status.
 /// </summary>
 /// <param name="status">The error status with which to create it.</param>
 public PolyStatusOr(PolyStatus status)
 {
     if (status.ok)
     {
         throw new Exception("PolyStatusOr(PolyStatus) can only be used with an error status.");
     }
     this.status = status;
     this.value  = default(T);
 }
Beispiel #3
0
 public PolyFormatTypeFetchResult(PolyStatus status, PolyAsset asset)
 {
     this.status = status;
     this.asset  = asset;
 }
Beispiel #4
0
 /// <summary>
 /// Creates a PolyStatusOr with the given value.
 /// The status will be set to success.
 /// </summary>
 /// <param name="value">The value with which to create it.</param>
 public PolyStatusOr(T value)
 {
     this.status = PolyStatus.Success();
     this.value  = value;
 }
Beispiel #5
0
 /// <summary>
 /// Creates a new error status with the given error message and cause.
 /// The error message will automatically include all error messages in the causal chain.
 /// </summary>
 public static PolyStatus Error(PolyStatus cause, string format, params object[] args)
 {
     return(new PolyStatus(false, string.Format(format, args) + "\nCaused by: " + cause.errorMessage));
 }
Beispiel #6
0
 /// <summary>
 /// Creates a new error status with the given error message and cause.
 /// The error message will automatically include all error messages in the causal chain.
 /// </summary>
 public static PolyStatus Error(PolyStatus cause, string errorMessage)
 {
     return(new PolyStatus(false, errorMessage + "\nCaused by: " + cause.errorMessage));
 }