btcpayserver/BTCPayServer/UnresolvedUri.cs
d11n 4c303d358b
Branding updates for 2.0 (#5947)
* Remove deprecated CSS options

Closes #5945.

* Greenfield: Add brandColor to store APIs

Closes #5946.

* Migrate file IDs to URLs

Closes #5953.

* Greenfield: Add CSS and logo URL to store settings API

Closes #5945.

* Add migration test

* Store and Server branding can reference file's via fileid:ID

* Add PaymentSoundUrl to Store API

---------

Co-authored-by: nicolas.dorier <nicolas.dorier@gmail.com>
2024-05-09 09:18:02 +09:00

26 lines
704 B
C#

using System;
namespace BTCPayServer
{
public record UnresolvedUri
{
public static UnresolvedUri Create(string str)
{
ArgumentNullException.ThrowIfNull(str);
if (str.StartsWith("fileid:", StringComparison.OrdinalIgnoreCase))
{
return new FileIdUri(str.Substring("fileid:".Length));
}
return new Raw(str);
}
public record FileIdUri(string FileId) : UnresolvedUri
{
public override string ToString() => $"fileid:{FileId}";
}
public record Raw(string Uri) : UnresolvedUri
{
public override string ToString() => Uri;
}
}
}