Skip to content

Commit

Permalink
Update data models (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
openactive-bot authored Jun 14, 2022
1 parent dc4514c commit dd55185
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 15 deletions.
14 changes: 14 additions & 0 deletions OpenActive.NET/enums/PropertyEnumeration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public enum PropertyEnumeration
UnitTaxSpecification,
[EnumMember(Value = "https://openactive.io/validFromBeforeStartDate")]
ValidFromBeforeStartDate,
[EnumMember(Value = "https://openactive.io/validThroughBeforeStartDate")]
ValidThroughBeforeStartDate,
[EnumMember(Value = "https://openactive.io/valueOption")]
ValueOption,
[EnumMember(Value = "https://schema.org/about")]
Expand Down Expand Up @@ -309,6 +311,8 @@ public enum PropertyEnumeration
Antagonist,
[EnumMember(Value = "https://schema.org/appearance")]
Appearance,
[EnumMember(Value = "https://schema.org/applicableCountry")]
ApplicableCountry,
[EnumMember(Value = "https://schema.org/applicableLocation")]
ApplicableLocation,
[EnumMember(Value = "https://schema.org/applicantLocationRequirements")]
Expand Down Expand Up @@ -1231,8 +1235,14 @@ public enum PropertyEnumeration
FundedItem,
[EnumMember(Value = "https://schema.org/funder")]
Funder,
[EnumMember(Value = "https://schema.org/funding")]
Funding,
[EnumMember(Value = "https://schema.org/game")]
Game,
[EnumMember(Value = "https://schema.org/gameAvailabilityType")]
GameAvailabilityType,
[EnumMember(Value = "https://schema.org/gameEdition")]
GameEdition,
[EnumMember(Value = "https://schema.org/gameItem")]
GameItem,
[EnumMember(Value = "https://schema.org/gameLocation")]
Expand Down Expand Up @@ -1309,6 +1319,8 @@ public enum PropertyEnumeration
GuidelineSubject,
[EnumMember(Value = "https://schema.org/handlingTime")]
HandlingTime,
[EnumMember(Value = "https://schema.org/hasAdultConsideration")]
HasAdultConsideration,
[EnumMember(Value = "https://schema.org/hasBioChemEntityPart")]
HasBioChemEntityPart,
[EnumMember(Value = "https://schema.org/hasBioPolymerSequence")]
Expand Down Expand Up @@ -1571,6 +1583,8 @@ public enum PropertyEnumeration
Isbn,
[EnumMember(Value = "https://schema.org/isicV4")]
IsicV4,
[EnumMember(Value = "https://schema.org/iso6523Code")]
Iso6523Code,
[EnumMember(Value = "https://schema.org/isrcCode")]
IsrcCode,
[EnumMember(Value = "https://schema.org/issn")]
Expand Down
8 changes: 4 additions & 4 deletions OpenActive.NET/models/Entitlement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ public override string ToString()
/// The date the entitlement becomes valid. This must be in the past.
/// </summary>
[DataMember(Name = "validFrom", EmitDefaultValue = false, Order = 9)]
[JsonConverter(typeof(OpenActiveDateTimeOffsetToISO8601DateTimeValuesConverter))]
public new virtual DateTimeOffset? ValidFrom { get; set; }
[JsonConverter(typeof(OpenActiveDateTimeValuesConverter))]
public new virtual DateValue ValidFrom { get; set; }

/// <summary>
/// The date that the entitlement is no longer valid. This must be in the future.
/// </summary>
[DataMember(Name = "validUntil", EmitDefaultValue = false, Order = 10)]
[JsonConverter(typeof(OpenActiveDateTimeOffsetToISO8601DateTimeValuesConverter))]
public new virtual DateTimeOffset? ValidUntil { get; set; }
[JsonConverter(typeof(OpenActiveDateTimeValuesConverter))]
public new virtual DateValue ValidUntil { get; set; }
}
}
18 changes: 14 additions & 4 deletions OpenActive.NET/models/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -749,13 +749,23 @@ public override string ToString()
[JsonConverter(typeof(ValuesConverter))]
public virtual bool? IsFirstSessionAccessibleForFree { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// A property that indicates whether the event contains a high frequency of occurrences. Intended as a UI hint for interfaces that represent these occurrences.
///
/// If you are using this property, please join the discussion at proposal [#301](https://github.com/openactive/modelling-opportunity-data/issues/301).
/// </summary>
[DataMember(Name = "beta:isScheduledAsSlots", EmitDefaultValue = false, Order = 1061)]
[JsonConverter(typeof(ValuesConverter))]
public virtual bool? IsScheduledAsSlots { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// Contact details for an Event, where they are not specifically related to the `organizer` or `leader`.
///
/// If you are using this property, please join the discussion at proposal [#113](https://github.com/openactive/modelling-opportunity-data/issues/113).
/// </summary>
[DataMember(Name = "beta:contactPoint", EmitDefaultValue = false, Order = 1061)]
[DataMember(Name = "beta:contactPoint", EmitDefaultValue = false, Order = 1062)]
[JsonConverter(typeof(ValuesConverter))]
public virtual Schema.NET.ContactPoint ContactPoint { get; set; }

Expand All @@ -765,22 +775,22 @@ public override string ToString()
///
/// If you are using this property, please join the discussion at proposal [#161](https://github.com/openactive/modelling-opportunity-data/issues/161).
/// </summary>
[DataMember(Name = "beta:bookingChannel", EmitDefaultValue = false, Order = 1062)]
[DataMember(Name = "beta:bookingChannel", EmitDefaultValue = false, Order = 1063)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<BookingChannelType> BookingChannel { get; set; }

/// <summary>
/// [NOTICE: This property is part of the Open Booking API Test Interface, and MUST NOT be used in production.]
/// </summary>
[DataMember(Name = "test:testOpenBookingFlow", EmitDefaultValue = false, Order = 1063)]
[DataMember(Name = "test:testOpenBookingFlow", EmitDefaultValue = false, Order = 1064)]
[JsonConverter(typeof(ValuesConverter))]
public virtual TestOpenBookingFlowEnumeration? TestOpenBookingFlow { get; set; }

/// <summary>
/// [NOTICE: This property is part of the Open Booking API Test Interface, and MUST NOT be used in production.]
/// The opportunity criteria which the Event conforms to.
/// </summary>
[DataMember(Name = "test:testOpportunityCriteria", EmitDefaultValue = false, Order = 1064)]
[DataMember(Name = "test:testOpportunityCriteria", EmitDefaultValue = false, Order = 1065)]
[JsonConverter(typeof(ValuesConverter))]
public virtual TestOpportunityCriteriaEnumeration? TestOpportunityCriteria { get; set; }
}
Expand Down
16 changes: 13 additions & 3 deletions OpenActive.NET/models/FacilityUse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public override string ToString()
/// </example>
[DataMember(Name = "provider", EmitDefaultValue = false, Order = 25)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual Organization Provider { get; set; }
public virtual Organization Provider { get; set; }

/// <summary>
/// A URL to a web page (or section of a page) that describes the facility use.
Expand Down Expand Up @@ -420,13 +420,23 @@ public override string ToString()
[JsonConverter(typeof(OpenActiveTimeSpanToISO8601DurationValuesConverter))]
public virtual TimeSpan? OfferValidityPeriod { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// Attributes associated with the facility in use. See https://openactive.io/facility-attribute-list/.
///
/// If you are using this property, please join the discussion at proposal [#1](https://github.com/openactive/facility-types/issues/1).
/// </summary>
[DataMember(Name = "beta:facilityAttribute", EmitDefaultValue = false, Order = 1032)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<Concept> FacilityAttribute { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// Whether the event or facility is indoor or outdoor.
///
/// If you are using this property, please join the discussion at proposal [#1](https://github.com/openactive/facility-types/issues/1).
/// </summary>
[DataMember(Name = "beta:facilitySetting", EmitDefaultValue = false, Order = 1032)]
[DataMember(Name = "beta:facilitySetting", EmitDefaultValue = false, Order = 1033)]
[JsonConverter(typeof(ValuesConverter))]
public virtual FacilitySettingType? FacilitySetting { get; set; }

Expand All @@ -436,7 +446,7 @@ public override string ToString()
///
/// If you are using this property, please join the discussion at proposal [#161](https://github.com/openactive/modelling-opportunity-data/issues/161).
/// </summary>
[DataMember(Name = "beta:bookingChannel", EmitDefaultValue = false, Order = 1033)]
[DataMember(Name = "beta:bookingChannel", EmitDefaultValue = false, Order = 1034)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<BookingChannelType> BookingChannel { get; set; }
}
Expand Down
11 changes: 9 additions & 2 deletions OpenActive.NET/models/Offer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,26 @@ public override string ToString()
public new virtual Uri Url { get; set; }

/// <summary>
/// The duration before the startDate for which this Offer is valid, given in ISO 8601 format. This is a relatively-defined equivalent of schema:validFrom, to allow for Offer inheritance.
/// The duration before the `startDate` for which this `Offer` is valid, given in ISO 8601 format. This is a relatively-defined equivalent of `schema:validFrom`, to allow for `Offer` inheritance.
/// </summary>
[DataMember(Name = "validFromBeforeStartDate", EmitDefaultValue = false, Order = 22)]
[JsonConverter(typeof(OpenActiveTimeSpanToISO8601DurationValuesConverter))]
public virtual TimeSpan? ValidFromBeforeStartDate { get; set; }

/// <summary>
/// The duration before the `startDate` after which the `Offer` is no longer valid, given in ISO 8601 format. This is a relatively-defined equivalent of `schema:validThrough`, to allow for `Offer` inheritance.
/// </summary>
[DataMember(Name = "validThroughBeforeStartDate", EmitDefaultValue = false, Order = 23)]
[JsonConverter(typeof(OpenActiveTimeSpanToISO8601DurationValuesConverter))]
public virtual TimeSpan? ValidThroughBeforeStartDate { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// Number of people the reservation should accommodate.
///
/// If you are using this property, please join the discussion at proposal [#250](https://github.com/openactive/modelling-opportunity-data/issues/250).
/// </summary>
[DataMember(Name = "beta:partySize", EmitDefaultValue = false, Order = 1023)]
[DataMember(Name = "beta:partySize", EmitDefaultValue = false, Order = 1024)]
[JsonConverter(typeof(ValuesConverter))]
public virtual QuantitativeValue PartySize { get; set; }
}
Expand Down
3 changes: 3 additions & 0 deletions OpenActive.NET/models/OfferOverride.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,8 @@ public override string ToString()

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

[Obsolete("This property is disinherited in this type, and must not be used.", true)]
public override TimeSpan? ValidThroughBeforeStartDate { get; set; }
}
}
22 changes: 21 additions & 1 deletion OpenActive.NET/models/Place.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public override string ToString()
/// </example>
[DataMember(Name = "containedInPlace", EmitDefaultValue = false, Order = 12)]
[JsonConverter(typeof(ValuesConverter))]
public new virtual Place ContainedInPlace { get; set; }
public new virtual ReferenceValue<Place> ContainedInPlace { get; set; }

/// <summary>
/// Places that exist within this place
Expand Down Expand Up @@ -256,5 +256,25 @@ public override string ToString()
[DataMember(Name = "beta:formattedDescription", EmitDefaultValue = false, Order = 1020)]
[JsonConverter(typeof(ValuesConverter))]
public virtual string FormattedDescription { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// A related video object.
///
/// If you are using this property, please join the discussion at proposal [#88](https://github.com/openactive/modelling-opportunity-data/issues/88).
/// </summary>
[DataMember(Name = "beta:video", EmitDefaultValue = false, Order = 1021)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<VideoObject> Video { get; set; }

/// <summary>
/// [NOTICE: This is a beta property, and is highly likely to change in future versions of this library.]
/// The type of Place. See https://openactive.io/place-types/.
///
/// If you are using this property, please join the discussion at proposal [#1](https://github.com/openactive/place-types/issues/1).
/// </summary>
[DataMember(Name = "beta:placeType", EmitDefaultValue = false, Order = 1022)]
[JsonConverter(typeof(ValuesConverter))]
public virtual List<Concept> PlaceType { get; set; }
}
}
11 changes: 10 additions & 1 deletion OpenActive.NET/models/Slot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,16 @@ public override string ToString()
[Obsolete("This property is disinherited in this type, and must not be used.", true)]
public override Event SuperEvent { get; set; }

[Obsolete("This property is disinherited in this type, and must not be used.", true)]
/// <summary>
/// A URL to a web page (or section of a page) that describes the specific Slot.
/// </summary>
/// <example>
/// <code>
/// "url": "https://example.com/slots/1234"
/// </code>
/// </example>
[DataMember(Name = "url", EmitDefaultValue = false, Order = 42)]
[JsonConverter(typeof(ValuesConverter))]
public override Uri Url { get; set; }

/// <summary>
Expand Down

0 comments on commit dd55185

Please sign in to comment.