Skip to content

Commit 0cbe702

Browse files
Support for Places feed and updated dataset site model (#61)
1 parent 7303778 commit 0cbe702

File tree

12 files changed

+183
-30
lines changed

12 files changed

+183
-30
lines changed

OpenActive.NET.Test/EventTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public void RootTypeMismatchError()
197197
public void ToString_EventAccessor()
198198
{
199199
output.WriteLine(this.@event.ToString());
200-
Assert.Equal("Santa Clara City Library, Central Park Library", this.@event.Location.Name);
200+
Assert.Equal("Santa Clara City Library, Central Park Library", this.@event.Location.Object.Name);
201201
}
202202

203203
[Fact]

OpenActive.NET.Test/RPDEGenericsTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public RPDEGenericsTest(ITestOutputHelper output)
2222
private static readonly SessionSeries @event = new OpenActive.NET.SessionSeries()
2323
{
2424
Name = "Virtual BODYPUMP",
25-
Description = "This is the virtual version of the original barbell class, which will help you get lean, toned and fit - fast. Les Mills™ Virtual classes are designed for people who cannot get access to our live classes or who want to get a ‘taste’ of a Les Mills™ class before taking a live class with an instructor. The classes are played on a big video screen, with dimmed lighting and pumping surround sound, and are led onscreen by the people who actually choreograph the classes.",
25+
Description = "This is the virtual version of the original barbell class, which will help you get lean, toned and fit - fast. Les Mills™ Virtual classes are designed for people who cannot get access to our live classes or who want to get a ‘taste’ of a Les Mills™ class before taking a live class with an instructor. The classes are played on a big video screen, with dimmed lighting and pumping surround sound, and are led onscreen by the people who actually choreograph the classes.",
2626
Duration = TimeSpan.FromDays(1),
2727
StartDate = new DateTimeOffset(2017, 4, 24, 19, 30, 0, TimeSpan.FromHours(-8)),
2828
Location = new Place()
@@ -206,13 +206,13 @@ public RPDEGenericsTest(ITestOutputHelper output)
206206
};
207207

208208
private readonly string jsonRpde =
209-
"{\"next\":\"https://www.example.com/feed?afterTimestamp=5&afterId=1\",\"items\":[{\"state\":\"updated\",\"kind\":\"SessionSeries\",\"id\":\"2\",\"modified\":4,\"data\":{\"@context\":\"https://openactive.io/\",\"@type\":\"SessionSeries\",\"name\":\"Virtual BODYPUMP\",\"description\":\"This is the virtual version of the original barbell class, which will help you get lean, toned and fit - fast. Les Mills™ Virtual classes are designed for people who cannot get access to our live classes or who want to get a ‘taste’ of a Les Mills™ class before taking a live class with an instructor. The classes are played on a big video screen, with dimmed lighting and pumping surround sound, and are led onscreen by the people who actually choreograph the classes.\",\"attendeeInstructions\":\"Ensure you bring trainers and a bottle of water.\",\"duration\":\"P1D\",\"image\":[{\"@type\":\"ImageObject\",\"url\":\"http://www.example.com/event_image/12345\"}],\"location\":{\"@type\":\"Place\",\"name\":\"Santa Clara City Library, Central Park Library\",\"address\":{\"@type\":\"PostalAddress\",\"addressCountry\":\"US\",\"addressLocality\":\"Santa Clara\",\"addressRegion\":\"CA\",\"postalCode\":\"95051\",\"streetAddress\":\"2635 Homestead Rd\"}},\"offers\":[{\"@type\":\"Offer\",\"price\":30.0,\"priceCurrency\":\"USD\",\"url\":\"https://www.example.com/event_offer/12345_201803180430\",\"validFrom\":\"2017-01-20T16:20:00-08:00\"}],\"startDate\":\"2017-04-24T19:30:00-08:00\",\"endDate\":\"2017-04-24T23:00:00-08:00\"}},{\"state\":\"deleted\",\"kind\":\"SessionSeries\",\"id\":\"1\",\"modified\":5}],\"license\":\"https://creativecommons.org/licenses/by/4.0/\"}";
209+
"{\"next\":\"https://www.example.com/feed?afterTimestamp=5&afterId=1\",\"items\":[{\"state\":\"updated\",\"kind\":\"SessionSeries\",\"id\":\"2\",\"modified\":4,\"data\":{\"@context\":\"https://openactive.io/\",\"@type\":\"SessionSeries\",\"name\":\"Virtual BODYPUMP\",\"description\":\"This is the virtual version of the original barbell class, which will help you get lean, toned and fit - fast. Les Mills™ Virtual classes are designed for people who cannot get access to our live classes or who want to get a ‘taste’ of a Les Mills™ class before taking a live class with an instructor. The classes are played on a big video screen, with dimmed lighting and pumping surround sound, and are led onscreen by the people who actually choreograph the classes.\",\"attendeeInstructions\":\"Ensure you bring trainers and a bottle of water.\",\"duration\":\"P1D\",\"image\":[{\"@type\":\"ImageObject\",\"url\":\"http://www.example.com/event_image/12345\"}],\"location\":{\"@type\":\"Place\",\"name\":\"Santa Clara City Library, Central Park Library\",\"address\":{\"@type\":\"PostalAddress\",\"addressCountry\":\"US\",\"addressLocality\":\"Santa Clara\",\"addressRegion\":\"CA\",\"postalCode\":\"95051\",\"streetAddress\":\"2635 Homestead Rd\"}},\"offers\":[{\"@type\":\"Offer\",\"price\":30.0,\"priceCurrency\":\"USD\",\"url\":\"https://www.example.com/event_offer/12345_201803180430\",\"validFrom\":\"2017-01-20T16:20:00-08:00\"}],\"startDate\":\"2017-04-24T19:30:00-08:00\",\"endDate\":\"2017-04-24T23:00:00-08:00\"}},{\"state\":\"deleted\",\"kind\":\"SessionSeries\",\"id\":\"1\",\"modified\":5}],\"license\":\"https://creativecommons.org/licenses/by/4.0/\"}";
210210

211211
private readonly string jsonRpdeEveryoneActive =
212212
"{\"next\":\"https://opendata.leisurecloud.live/api/feeds/EveryoneActive-test-session-series?afterTimestamp=28577192&afterId=1217CRP17000217\",\"items\":[{\"state\":\"updated\",\"kind\":\"SessionSeries\",\"id\" :\"1502CMX20000216\",\"modified\":15529138,\"data\":{\"@context\":[\"https://openactive.io/\",\"https://openactive.io/ns-beta\"],\"type\":\"SessionSeries\",\"id\":\"https://tst.myeveryoneactive.com/OpenActive/api/session-series/2011CAQ15150119\",\"eventSchedule\":[{\"type\":\"PartialSchedule\",\"byDay\":[\"http://schema.org/Monday\"],\"duration\":\"PT45M\",\"endTime\":\"16:00\",\"startDate\":\"2019-04-01\",\"endDate\":\"2022-12-31\",\"startTime\":\"15:15\",\"beta:timeZone\":\"Europe/London\"}],\"identifier\":\"2011CAQ15150119\",\"name\":\"Active Aqua Mon 15:15\",\"category\":[\"Group Exercise 16+ Yrs\"],\"duration\":\"PT45M\",\"location\":{\"type\":\"Place\",\"identifier\":\"0201\",\"name\":\"Wythenshawe Forum Leisure\",\"address\":{\"type\":\"PostalAddress\",\"addressCountry\":\"GB\",\"addressLocality\":\"Wythenshawe\",\"addressRegion\":\"Manchester\",\"postalCode\":\"M22 5RX\",\"streetAddress\":\"Forum Square\"},\"amenityFeature\":[{\"type\":\"ChangingFacilities\",\"name\":\"Changing Facilities\",\"value\":true},{\"type\":\"Showers\",\"name\":\"Showers\",\"value\":true},{\"type\":\"Toilets\",\"name\":\"Toilets\",\"value\":true},{\"type\":\"Lockers\",\"name\":\"Lockers\",\"value\":true},{\"type\":\"Towels\",\"name\":\"Towels\",\"value\":false},{\"type\":\"Creche\",\"name\":\"Creche\",\"value\":false},{\"type\":\"Parking\",\"name\":\"Parking\",\"value\":false},{\"type\":\"BabyChanging\",\"name\":\"Baby Changing\",\"value\":true},{\"type\":\"beta:Cafe\",\"name\":\"Cafe\",\"value\":false},{\"type\":\"beta:Bar\",\"name\":\"Bar\",\"value\":false}],\"geo\":{\"type\":\"GeoCoordinates\",\"latitude\":53.380323,\"longitude\":-2.265142},\"telephone\":\"0161 935 4020\",\"url\":\"https://www-everyoneactive-dev.mediablazegroup.com/centre/wythenshawe-forum/\",\"beta:formattedDescription\":\"<p><br></p>\"},\"offers\":[{\"type\":\"Offer\",\"identifier\":\"STAND\",\"name\":\"Adult\",\"description\":\"Grp Ex - Aqua\",\"acceptedPaymentMethod\":[\"http://purl.org/goodrelations/v1#Cash\",\"http://purl.org/goodrelations/v1#PaymentMethodCreditCard\"],\"price\":1.0,\"priceCurrency\":\"GBP\"}],\"superEvent\":{\"type\":\"EventSeries\",\"identifier\":93,\"name\":\"Aqua Aerobics\",\"description\":\"A dedicated instructor led session for pregnant women or new mums only that provides an invigorating and safe all-over body work-out in the water with minimal impact.\",\"activity\":[{\"type\":\"Concept\",\"id\":\"https://openactive.io/activity-list#6e31262b-ce37-4fc7-b3e3-d827ac5e8b42\",\"inScheme\":\"https://openactive.io/activity-list\",\"prefLabel\":\"aqua_aerobics\"}],\"ageRange\":{\"type\":\"QuantitativeValue\",\"maxValue\":100,\"minValue\":16},\"isCoached\":true,\"organizer\":{\"type\":\"Organization\",\"name\":\"EveryoneActive\",\"legalName\":\"EveryoneActive\"}}}}],\"license\":\"https://creativecommons.org/licenses/by/4.0/\"}";
213213

214214
private readonly string jsonRpdeSlotEveryoneActive =
215-
"{\"next\":\"https://opendata.leisurecloud.live/api/feeds/EveryoneActive-test-slots?afterTimestamp=2564761380&afterId=162OUTDOOR10_2020-03-04T18-30-00\",\"items\":[{\"state\":\"updated\",\"kind\":\"FacilityUse/Slot\",\"id\" :\"161ASTRO001_2020-03-04T16-00-00\",\"modified\":2564739554,\"data\":{\"@context\":[\"https://openactive.io/\",\"https://openactive.io/ns-beta\"],\"type\":\"Slot\",\"id\":\"https://tst.myeveryoneactive.com/OpenActive/api/slots/161ASTRO001_2020-03-04T16-00-00\",\"identifier\":\"161ASTRO001_2020-03-04T16-00-00\",\"duration\":\"PT1H\",\"facilityUse\":\"https://tst.myeveryoneactive.com/OpenActive/api/facility-uses/161ASTRO001\",\"maximumUses\":1,\"offers\":[{\"type\":\"Offer\",\"price\":169.3,\"priceCurrency\":\"GBP\"}],\"remainingUses\":1,\"startDate\":\"2020-03-04T16:00:00+00:00\",\"endDate\":\"2020-03-04T17:00:00+00:00\",\"beta:sportsActivityLocation\":[{\"type\":\"SportsActivityLocation\",\"name\":[\"Burgess Park Astroturf 1\",\"Burgess Park Astroturf 2\",\"Burgess Park Astroturf 3\"],\"identifier\":[\"161ZOUA001\",\"161ZOUA002\",\"161ZOUA003\"]}]}}],\"license\":\"https://creativecommons.org/licenses/by/4.0/\"}";
215+
"{\"next\":\"https://opendata.leisurecloud.live/api/feeds/EveryoneActive-test-slots?afterTimestamp=2564761380&afterId=162OUTDOOR10_2020-03-04T18-30-00\",\"items\":[{\"state\":\"updated\",\"kind\":\"FacilityUse/Slot\",\"id\" :\"161ASTRO001_2020-03-04T16-00-00\",\"modified\":2564739554,\"data\":{\"@context\":[\"https://openactive.io/\",\"https://openactive.io/ns-beta\"],\"type\":\"Slot\",\"id\":\"https://tst.myeveryoneactive.com/OpenActive/api/slots/161ASTRO001_2020-03-04T16-00-00\",\"identifier\":\"161ASTRO001_2020-03-04T16-00-00\",\"duration\":\"PT1H\",\"facilityUse\":\"https://tst.myeveryoneactive.com/OpenActive/api/facility-uses/161ASTRO001\",\"maximumUses\":1,\"offers\":[{\"type\":\"Offer\",\"price\":169.3,\"priceCurrency\":\"GBP\"}],\"remainingUses\":1,\"startDate\":\"2020-03-04T16:00:00+00:00\",\"endDate\":\"2020-03-04T17:00:00+00:00\",\"beta:sportsActivityLocation\":[{\"type\":\"SportsActivityLocation\",\"name\":\"Burgess Park Astroturf 1\",\"identifier\":\"161ZOUA001\"}]}}],\"license\":\"https://creativecommons.org/licenses/by/4.0/\"}";
216216

217217
[Fact]
218218
public void ToString_EventGoogleStructuredData_ReturnsExpectedJsonLd()

OpenActive.NET/enums/PropertyEnumeration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public enum PropertyEnumeration
5555
EligibleEntitlementType,
5656
[EnumMember(Value = "https://openactive.io/emergencyContact")]
5757
EmergencyContact,
58+
[EnumMember(Value = "https://openactive.io/endpointUrl")]
59+
EndpointUrl,
5860
[EnumMember(Value = "https://openactive.io/entitlement")]
5961
Entitlement,
6062
[EnumMember(Value = "https://openactive.io/entitlementType")]

OpenActive.NET/models/BookingService.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,31 @@ public override string ToString()
5151
[JsonConverter(typeof(ValuesConverter))]
5252
public new virtual string Name { get; set; }
5353

54+
/// <summary>
55+
/// A human and machine-readable certification file that asserts the service's conformance to established standards. The value of this property should be a URL that resolves to a valid and up-to-date OpenActive Test Suite Conformance Certificate for this implementation. Note this property is in EARLY RELEASE AND IS SUBJECT TO CHANGE, as the [Dataset API Discovery specification](https://openactive.io/dataset-api-discovery/EditorsDraft/) evolves.
56+
/// </summary>
57+
[DataMember(Name = "hasCredential", EmitDefaultValue = false, Order = 8)]
58+
[JsonConverter(typeof(ValuesConverter))]
59+
public virtual Uri HasCredential { get; set; }
60+
5461
/// <summary>
5562
/// The version of the application, useful for on-premise installations. Note this property is in EARLY RELEASE AND IS SUBJECT TO CHANGE, as the [Dataset API Discovery specification](https://openactive.io/dataset-api-discovery/EditorsDraft/) evolves.
5663
/// </summary>
57-
[DataMember(Name = "softwareVersion", EmitDefaultValue = false, Order = 8)]
64+
[DataMember(Name = "softwareVersion", EmitDefaultValue = false, Order = 9)]
5865
[JsonConverter(typeof(ValuesConverter))]
5966
public new virtual string SoftwareVersion { get; set; }
6067

6168
/// <summary>
6269
/// The terms of service of the Booking System.
6370
/// </summary>
64-
[DataMember(Name = "termsOfService", EmitDefaultValue = false, Order = 9)]
71+
[DataMember(Name = "termsOfService", EmitDefaultValue = false, Order = 10)]
6572
[JsonConverter(typeof(ValuesConverter))]
6673
public virtual List<Terms> TermsOfService { get; set; }
6774

6875
/// <summary>
6976
/// The URL of the website of the Booking System.
7077
/// </summary>
71-
[DataMember(Name = "url", EmitDefaultValue = false, Order = 10)]
78+
[DataMember(Name = "url", EmitDefaultValue = false, Order = 11)]
7279
[JsonConverter(typeof(ValuesConverter))]
7380
public new virtual Uri Url { get; set; }
7481
}

OpenActive.NET/models/Event.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public override string ToString()
412412
/// </example>
413413
[DataMember(Name = "location", EmitDefaultValue = false, Order = 30)]
414414
[JsonConverter(typeof(ValuesConverter))]
415-
public new virtual Place Location { get; set; }
415+
public new virtual ReferenceValue<Place> Location { get; set; }
416416

417417
/// <summary>
418418
/// The maximum capacity of the Event.
@@ -657,7 +657,7 @@ public override string ToString()
657657
/// </summary>
658658
[DataMember(Name = "beta:sportsActivityLocation", EmitDefaultValue = false, Order = 1051)]
659659
[JsonConverter(typeof(ValuesConverter))]
660-
public virtual List<Schema.NET.SportsActivityLocation> SportsActivityLocation { get; set; }
660+
public virtual List<SportsActivityLocation> SportsActivityLocation { get; set; }
661661

662662
/// <summary>
663663
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]

OpenActive.NET/models/FacilityUse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public override string ToString()
321321
/// </example>
322322
[DataMember(Name = "location", EmitDefaultValue = false, Order = 23)]
323323
[JsonConverter(typeof(ValuesConverter))]
324-
public new virtual Place Location { get; set; }
324+
public new virtual ReferenceValue<Place> Location { get; set; }
325325

326326
/// <summary>
327327
/// An array of schema:Offer that include the price of booking.
@@ -408,7 +408,7 @@ public override string ToString()
408408
/// </summary>
409409
[DataMember(Name = "beta:sportsActivityLocation", EmitDefaultValue = false, Order = 1030)]
410410
[JsonConverter(typeof(ValuesConverter))]
411-
public virtual List<Schema.NET.SportsActivityLocation> SportsActivityLocation { get; set; }
411+
public virtual List<SportsActivityLocation> SportsActivityLocation { get; set; }
412412

413413
/// <summary>
414414
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]

OpenActive.NET/models/OnDemandEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public override string ToString()
5151
public override Schema.NET.EventStatusType? EventStatus { get; set; }
5252

5353
[Obsolete("This property is disinherited in this type, and must not be used.", true)]
54-
public override Place Location { get; set; }
54+
public override ReferenceValue<Place> Location { get; set; }
5555

5656
[Obsolete("This property is disinherited in this type, and must not be used.", true)]
5757
public override long? MaximumAttendeeCapacity { get; set; }

0 commit comments

Comments
 (0)