Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add delivery channel properties to the customer and space Hydra models #732

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions src/protagonist/DLCS.HydraModel/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Newtonsoft.Json;

namespace DLCS.HydraModel;

[HydraClass(typeof(CustomerClass),
Description = "A customer represents you, the API user. You only have access to one customer, " +
"so it is your effective entry point for the API. The only interaction you can have with " +
Expand Down Expand Up @@ -64,58 +64,70 @@ public Customer(string baseUrl, int customerId, string name, string displayName)
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 15, PropertyName = "originStrategies")]
public string? OriginStrategies { get; set; }


[HydraLink(Description = "Collection of further collections containing your delivery channel policies. Policies will be" +
" organised by their intended delivery channel.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 16, PropertyName = "deliveryChannelPolicies")]
public string? DeliveryChannelPolicies { get; set; }

[HydraLink(Description = "Collection of default delivery channels. Assets without any delivery channels specified will be served by those" +
" configured here (unless overriden by the containing space's default delivery channels). See the DeliveryChannels topic.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 17, PropertyName = "defaultDeliveryChannels")]
public string? DefaultDeliveryChannels { get; set; }

[HydraLink(Description = "Collection of IIIF Authentication services available for use with your images. The images are" +
" associated with the auth services via Roles. An AuthService is a means of acquiring a role.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 16, PropertyName = "authServices")]
[JsonProperty(Order = 18, PropertyName = "authServices")]
public string? AuthServices { get; set; }

[HydraLink(Description = "Collection of external services which provide aq login page (typically) and an endpoint " +
" from which the DLCS acquires the user's named roles. This enables integration with external auth mechanisms.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 17, PropertyName = "roleProviders")]
[JsonProperty(Order = 19, PropertyName = "roleProviders")]
public string? RoleProviders { get; set; }

[HydraLink(Description = "Collection of the available roles you can assign to your images. In order for a user to see an image, the " +
"user must have the role associated with the image, or one of them. Users interact with an AuthService to " +
"acquire a role or roles.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 18, PropertyName = "roles")]
[JsonProperty(Order = 20, PropertyName = "roles")]
public string? Roles { get; set; }

[HydraLink(Description = "The Customer's view on the DLCS ingest queue. As well as allowing you to query the status of batches you " +
"have registered, you can POST new batches to the queue.",
Range = "vocab:Queue", ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 19, PropertyName = "queue")]
[JsonProperty(Order = 21, PropertyName = "queue")]
public string? Queue { get; set; }

[HydraLink(Description = "Collection of all the Space resources associated with your customer. A space allows you to " +
"partition images, have different default roles and tags, etc. See the Space topic.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 20, PropertyName = "spaces")]
[JsonProperty(Order = 22, PropertyName = "spaces")]
public string? Spaces { get; set; }

[HydraLink(Description = "A paged collection of all the customer's images, regardless of space",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 21, PropertyName = "allImages")]
[JsonProperty(Order = 23, PropertyName = "allImages")]
public string? AllImages { get; set; }

[HydraLink(Description = "Storage policy for the Customer",
Range = "vocab:CustomerStorage", ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 22, PropertyName = "storage")]
[JsonProperty(Order = 24, PropertyName = "storage")]
public string? Storage { get; set; }

[HydraLink(Description = "Api keys allocated to this customer. The accompanying secret is only available at creation time. " +
"To obtain a key and a secret, make an empty POST to this collection with administrator privileges and the returned " +
"Key object will include the generates secret.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 23, PropertyName = "keys")]
[JsonProperty(Order = 25, PropertyName = "keys")]
public string? Keys { get; set; }

[HydraLink(Description = "Additional HTTP headers (e.g., for caching) that will be sent for assets that match a role.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 23, PropertyName = "customHeaders")]
[JsonProperty(Order = 26, PropertyName = "customHeaders")]
public string? CustomHeaders { get; set; }

[RdfProperty(Description = "Is this user the admin customer?",
Expand Down
10 changes: 7 additions & 3 deletions src/protagonist/DLCS.HydraModel/Space.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Newtonsoft.Json;

namespace DLCS.HydraModel;

[HydraClass(typeof(SpaceClass),
Description = "Spaces allow you to partition images into groups. You can use them to organise your " +
"images logically, like folders. You can also define different default settings to apply " +
Expand Down Expand Up @@ -64,8 +64,6 @@ public Space(string baseUrl, int modelId, int customerId)
[JsonProperty(Order = 14, PropertyName = "approximateNumberOfImages")]
public long? ApproximateNumberOfImages { get; set; }



[RdfProperty(Description = "Default roles that will be applied to images in this space",
Range = Names.XmlSchema.String, ReadOnly = false, WriteOnly = false)]
[JsonProperty(Order = 20, PropertyName = "defaultRoles")]
Expand All @@ -76,6 +74,12 @@ public Space(string baseUrl, int modelId, int customerId)
[JsonProperty(Order = 22, PropertyName = "images")]
public string? Images { get; set; }

[HydraLink(Description = "Collection of default delivery channels. Assets without any delivery channels specified will be served by those" +
" configured here. See the DeliveryChannels topic.",
Range = Names.Hydra.Collection, ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 23, PropertyName = "defaultDeliveryChannels")]
public string? DefaultDeliveryChannels { get; set; }

[HydraLink(Description = "Metadata options for the space", // TOOD- what exactly?
Range = "vocab:Metadata", ReadOnly = true, WriteOnly = false)]
[JsonProperty(Order = 24, PropertyName = "metadata")]
Expand Down
Loading