Skip to content

Commit

Permalink
Add support for instanceOfCourse (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
openactive-bot authored May 26, 2021
1 parent c47f990 commit b142e64
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions OpenActive.NET/enums/PropertyEnumeration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public enum PropertyEnumeration
IndividualFacilityUse,
[EnumMember(Value = "https://openactive.io/instance")]
Instance,
[EnumMember(Value = "https://openactive.io/instanceOfCourse")]
InstanceOfCourse,
[EnumMember(Value = "https://openactive.io/isCoached")]
IsCoached,
[EnumMember(Value = "https://openactive.io/isOpenBookingAllowed")]
Expand Down
21 changes: 16 additions & 5 deletions OpenActive.NET/models/CourseInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public override string ToString()
[JsonConverter(typeof(ValuesConverter))]
public virtual List<Schedule> EventSchedule { get; set; }

/// <summary>
/// The description of the Course for which this is a distinct instance.
/// </summary>
[DataMember(Name = "instanceOfCourse", EmitDefaultValue = false, Order = 8)]
[JsonConverter(typeof(ValuesConverter))]
public virtual Course InstanceOfCourse { get; set; }

/// <summary>
/// The start date of this course.
/// </summary>
Expand All @@ -75,7 +82,7 @@ public override string ToString()
/// "startDate": "2018-01-06"
/// </code>
/// </example>
[DataMember(Name = "startDate", EmitDefaultValue = false, Order = 8)]
[DataMember(Name = "startDate", EmitDefaultValue = false, Order = 9)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual string StartDate { get; set; }

Expand All @@ -87,25 +94,29 @@ public override string ToString()
/// "endDate": "2018-01-27"
/// </code>
/// </example>
[DataMember(Name = "endDate", EmitDefaultValue = false, Order = 9)]
[DataMember(Name = "endDate", EmitDefaultValue = false, Order = 10)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual string EndDate { get; set; }

/// <summary>
/// The occurrences of this CourseInstance.
/// </summary>
[DataMember(Name = "subEvent", EmitDefaultValue = false, Order = 10)]
[DataMember(Name = "subEvent", EmitDefaultValue = false, Order = 11)]
[JsonConverter(typeof(ValuesConverter))]
public override List<Event> SubEvent { get; set; }

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

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// [DEPRECATED: This term has graduated from the beta namespace and is highly likely to be removed in future versions of this library, please use `instanceOfCourse` instead.]
/// This course for which this is an offering.
///
/// If you are using this property, please join the discussion at proposal [#164](https://github.com/openactive/modelling-opportunity-data/issues/164).
/// </summary>
[DataMember(Name = "beta:course", EmitDefaultValue = false, Order = 1011)]
[DataMember(Name = "beta:course", EmitDefaultValue = false, Order = 1013)]
[JsonConverter(typeof(ValuesConverter))]
[Obsolete("This term has graduated from the beta namespace and is highly likely to be removed in future versions of this library, please use `instanceOfCourse` instead.", false)]
public virtual Course Course { get; set; }
}
}
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "15.0",
"version": "15.1",
"publicReleaseRefSpec": [
"^refs/heads/master$"
],
Expand Down

0 comments on commit b142e64

Please sign in to comment.