Skip to content

Commit 0a583be

Browse files
Update data models (#50)
1 parent 3fe60bf commit 0a583be

4 files changed

Lines changed: 56 additions & 4 deletions

File tree

OpenActive.NET/enums/OrderItemStatus.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ public enum OrderItemStatus
1212
CustomerCancelled,
1313
[EnumMember(Value = "https://openactive.io/OrderItemConfirmed")]
1414
OrderItemConfirmed,
15-
[EnumMember(Value = "https://openactive.io/CustomerAttended")]
16-
CustomerAttended
15+
[EnumMember(Value = "https://openactive.io/AttendeeAttended")]
16+
AttendeeAttended,
17+
[EnumMember(Value = "https://openactive.io/AttendeeAbsent")]
18+
AttendeeAbsent
1719
}
1820
}

OpenActive.NET/enums/TestOpportunityCriteriaEnumeration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public enum TestOpportunityCriteriaEnumeration
1414
TestOpportunityBookableInPast,
1515
[EnumMember(Value = "https://openactive.io/test-interface#TestOpportunityBookableNoSpaces")]
1616
TestOpportunityBookableNoSpaces,
17+
[EnumMember(Value = "https://openactive.io/test-interface#TestOpportunityBookableOneSpace")]
18+
TestOpportunityBookableOneSpace,
1719
[EnumMember(Value = "https://openactive.io/test-interface#TestOpportunityBookableFiveSpaces")]
1820
TestOpportunityBookableFiveSpaces,
1921
[EnumMember(Value = "https://openactive.io/test-interface#TestOpportunityBookableFree")]

OpenActive.NET/models/OpportunityAttendanceUpdateSimulateAction.cs renamed to OpenActive.NET/models/AttendeeAbsentSimulateAction.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace OpenActive.NET
1010
/// This type is derived from https://schema.org/Action, which means that any of this type's properties within schema.org may also be used.
1111
/// </summary>
1212
[DataContract]
13-
public partial class OpportunityAttendanceUpdateSimulateAction : OpenBookingSimulateAction
13+
public partial class AttendeeAbsentSimulateAction : OpenBookingSimulateAction
1414
{
1515
/// <summary>
1616
/// Returns the JSON-LD representation of this instance.
@@ -43,6 +43,6 @@ public override string ToString()
4343
/// Gets the name of the type as specified by schema.org.
4444
/// </summary>
4545
[DataMember(Name = "@type", Order = 1)]
46-
public override string Type => "test:OpportunityAttendanceUpdateSimulateAction";
46+
public override string Type => "test:AttendeeAbsentSimulateAction";
4747
}
4848
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Newtonsoft.Json;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Runtime.Serialization;
5+
6+
namespace OpenActive.NET
7+
{
8+
/// <summary>
9+
/// [NOTICE: This class is part of the Open Booking API Test Interface, and MUST NOT be used in production.]
10+
/// This type is derived from https://schema.org/Action, which means that any of this type's properties within schema.org may also be used.
11+
/// </summary>
12+
[DataContract]
13+
public partial class AttendeeAttendedSimulateAction : OpenBookingSimulateAction
14+
{
15+
/// <summary>
16+
/// Returns the JSON-LD representation of this instance.
17+
/// This method overrides Schema.NET ToString() to serialise using OpenActiveSerializer.
18+
/// </summary>
19+
/// <returns>A <see cref="string" /> that represents the JSON-LD representation of this instance.</returns>
20+
public override string ToString()
21+
{
22+
return OpenActiveSerializer.Serialize(this);
23+
}
24+
25+
/// <summary>
26+
/// Returns the JSON-LD representation of this instance, including "https://schema.org" in the "@context".
27+
///
28+
/// This method must be used when you want to embed the output raw (as-is) into a web
29+
/// page. It uses serializer settings with HTML escaping to avoid Cross-Site Scripting (XSS)
30+
/// vulnerabilities if the object was constructed from an untrusted source.
31+
///
32+
/// This method overrides Schema.NET ToHtmlEscapedString() to serialise using OpenActiveSerializer.
33+
/// </summary>
34+
/// <returns>
35+
/// A <see cref="string" /> that represents the JSON-LD representation of this instance.
36+
/// </returns>
37+
public new string ToHtmlEscapedString()
38+
{
39+
return OpenActiveSerializer.SerializeToHtmlEmbeddableString(this);
40+
}
41+
42+
/// <summary>
43+
/// Gets the name of the type as specified by schema.org.
44+
/// </summary>
45+
[DataMember(Name = "@type", Order = 1)]
46+
public override string Type => "test:AttendeeAttendedSimulateAction";
47+
}
48+
}

0 commit comments

Comments
 (0)