-
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.
Merge pull request #734 from dlcs/hydra_new_deliverychannels
Add Hydra model for delivery channels
- Loading branch information
Showing
13 changed files
with
84 additions
and
53 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
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
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
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,38 @@ | ||
using Hydra; | ||
using Hydra.Model; | ||
using Newtonsoft.Json; | ||
|
||
namespace DLCS.HydraModel; | ||
|
||
[HydraClass(typeof(DeliveryChannelClass), | ||
Description = "A delivery channel represents a way an asset on the DLCS can be served.", | ||
UriTemplate = "")] | ||
public class DeliveryChannel : DlcsResource | ||
{ | ||
[RdfProperty(Description = "The name of the DLCS delivery channel this is based on.", | ||
Range = Names.XmlSchema.String, ReadOnly = false, WriteOnly = false)] | ||
[JsonProperty(Order = 11, PropertyName = "channel")] | ||
public string? Channel { get; set; } | ||
|
||
[HydraLink(Description = "The policy assigned to this delivery channel.", | ||
Range = "vocab:deliveryChannelPolicy", ReadOnly = false, WriteOnly = false)] | ||
[JsonProperty(Order = 12, PropertyName = "policy")] | ||
public string? Policy { get; set; } | ||
} | ||
|
||
public class DeliveryChannelClass: Class | ||
{ | ||
string operationId = "_:deliveryChannel_"; | ||
|
||
public DeliveryChannelClass() | ||
{ | ||
BootstrapViaReflection(typeof(DeliveryChannel)); | ||
} | ||
|
||
public override void DefineOperations() | ||
{ | ||
SupportedOperations = CommonOperations.GetStandardResourceOperations( | ||
operationId, "Delivery Channel", Id, | ||
"GET", "POST", "PUT", "PATCH", "DELETE"); | ||
} | ||
} |
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