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; }
/// <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); }
public PolyFormatTypeFetchResult(PolyStatus status, PolyAsset asset) { this.status = status; this.asset = asset; }
/// <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; }
/// <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)); }
/// <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)); }