Skip to content

Commit b142e64

Browse files
Add support for instanceOfCourse (#45)
1 parent c47f990 commit b142e64

3 files changed

Lines changed: 19 additions & 6 deletions

File tree

OpenActive.NET/enums/PropertyEnumeration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public enum PropertyEnumeration
5757
IndividualFacilityUse,
5858
[EnumMember(Value = "https://openactive.io/instance")]
5959
Instance,
60+
[EnumMember(Value = "https://openactive.io/instanceOfCourse")]
61+
InstanceOfCourse,
6062
[EnumMember(Value = "https://openactive.io/isCoached")]
6163
IsCoached,
6264
[EnumMember(Value = "https://openactive.io/isOpenBookingAllowed")]

OpenActive.NET/models/CourseInstance.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ public override string ToString()
6767
[JsonConverter(typeof(ValuesConverter))]
6868
public virtual List<Schedule> EventSchedule { get; set; }
6969

70+
/// <summary>
71+
/// The description of the Course for which this is a distinct instance.
72+
/// </summary>
73+
[DataMember(Name = "instanceOfCourse", EmitDefaultValue = false, Order = 8)]
74+
[JsonConverter(typeof(ValuesConverter))]
75+
public virtual Course InstanceOfCourse { get; set; }
76+
7077
/// <summary>
7178
/// The start date of this course.
7279
/// </summary>
@@ -75,7 +82,7 @@ public override string ToString()
7582
/// "startDate": "2018-01-06"
7683
/// </code>
7784
/// </example>
78-
[DataMember(Name = "startDate", EmitDefaultValue = false, Order = 8)]
85+
[DataMember(Name = "startDate", EmitDefaultValue = false, Order = 9)]
7986
[JsonConverter(typeof(ValuesConverter))]
8087
public new virtual string StartDate { get; set; }
8188

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

94101
/// <summary>
95102
/// The occurrences of this CourseInstance.
96103
/// </summary>
97-
[DataMember(Name = "subEvent", EmitDefaultValue = false, Order = 10)]
104+
[DataMember(Name = "subEvent", EmitDefaultValue = false, Order = 11)]
98105
[JsonConverter(typeof(ValuesConverter))]
99106
public override List<Event> SubEvent { get; set; }
100107

108+
[Obsolete("This property is disinherited in this type, and must not be used.", true)]
109+
public override Event SuperEvent { get; set; }
110+
101111
/// <summary>
102-
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
112+
/// [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.]
103113
/// This course for which this is an offering.
104114
///
105115
/// If you are using this property, please join the discussion at proposal [#164](https://github.com/openactive/modelling-opportunity-data/issues/164).
106116
/// </summary>
107-
[DataMember(Name = "beta:course", EmitDefaultValue = false, Order = 1011)]
117+
[DataMember(Name = "beta:course", EmitDefaultValue = false, Order = 1013)]
108118
[JsonConverter(typeof(ValuesConverter))]
119+
[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)]
109120
public virtual Course Course { get; set; }
110121
}
111122
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "15.0",
3+
"version": "15.1",
44
"publicReleaseRefSpec": [
55
"^refs/heads/master$"
66
],

0 commit comments

Comments
 (0)