Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Schema.NET.Tool/ViewModels/Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private string TypeString
}
else
{
return $"Values<{adjustedTypesString}>?";
return $"Values<{adjustedTypesString}>";
}
}
}
Expand Down
18 changes: 11 additions & 7 deletions Source/Schema.NET/Values{T1,T2,T3,T4}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Values(OneOrMany<T1> value)
this.Value2 = default;
this.Value3 = default;
this.Value4 = default;
this.HasValue1 = true;
this.HasValue1 = value.Count > 0;
this.HasValue2 = false;
this.HasValue3 = false;
this.HasValue4 = false;
Expand All @@ -44,7 +44,7 @@ public Values(OneOrMany<T2> value)
this.Value3 = default;
this.Value4 = default;
this.HasValue1 = false;
this.HasValue2 = true;
this.HasValue2 = value.Count > 0;
this.HasValue3 = false;
this.HasValue4 = false;
}
Expand All @@ -61,24 +61,24 @@ public Values(OneOrMany<T3> value)
this.Value4 = default;
this.HasValue1 = false;
this.HasValue2 = false;
this.HasValue3 = true;
this.HasValue3 = value.Count > 0;
this.HasValue4 = false;
}

/// <summary>
/// Initializes a new instance of the <see cref="Values{T1,T2,T3,T4}"/> struct.
/// </summary>
/// <param name="values">The value of type <typeparamref name="T4"/>.</param>
public Values(OneOrMany<T4> values)
/// <param name="value">The value of type <typeparamref name="T4"/>.</param>
public Values(OneOrMany<T4> value)
{
this.Value1 = default;
this.Value2 = default;
this.Value3 = default;
this.Value4 = values;
this.Value4 = value;
this.HasValue1 = false;
this.HasValue2 = false;
this.HasValue3 = false;
this.HasValue4 = true;
this.HasValue4 = value.Count > 0;
}

/// <summary>
Expand Down Expand Up @@ -501,6 +501,10 @@ public bool Equals(Values<T1, T2, T3, T4> other)
return this.Value4.Equals(other.Value4);
}
}
else if (!other.HasValue && !this.HasValue)
{
return true;
}

return false;
}
Expand Down
10 changes: 7 additions & 3 deletions Source/Schema.NET/Values{T1,T2,T3}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Values(OneOrMany<T1> value)
this.Value1 = value;
this.Value2 = default;
this.Value3 = default;
this.HasValue1 = true;
this.HasValue1 = value.Count > 0;
this.HasValue2 = false;
this.HasValue3 = false;
}
Expand All @@ -40,7 +40,7 @@ public Values(OneOrMany<T2> value)
this.Value2 = value;
this.Value3 = default;
this.HasValue1 = false;
this.HasValue2 = true;
this.HasValue2 = value.Count > 0;
this.HasValue3 = false;
}

Expand All @@ -55,7 +55,7 @@ public Values(OneOrMany<T3> value)
this.Value3 = value;
this.HasValue1 = false;
this.HasValue2 = false;
this.HasValue3 = true;
this.HasValue3 = value.Count > 0;
}

/// <summary>
Expand Down Expand Up @@ -425,6 +425,10 @@ public bool Equals(Values<T1, T2, T3> other)
return this.Value3.Equals(other.Value3);
}
}
else if (!other.HasValue && !this.HasValue)
{
return true;
}

return false;
}
Expand Down
8 changes: 6 additions & 2 deletions Source/Schema.NET/Values{T1,T2}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Values(OneOrMany<T1> value)
{
this.Value1 = value;
this.Value2 = default;
this.HasValue1 = true;
this.HasValue1 = value.Count > 0;
this.HasValue2 = false;
}

Expand All @@ -36,7 +36,7 @@ public Values(OneOrMany<T2> value)
this.Value1 = default;
this.Value2 = value;
this.HasValue1 = false;
this.HasValue2 = true;
this.HasValue2 = value.Count > 0;
}

/// <summary>
Expand Down Expand Up @@ -324,6 +324,10 @@ public bool Equals(Values<T1, T2> other)
return this.Value2.Equals(other.Value2);
}
}
else if (!other.HasValue && !this.HasValue)
{
return true;
}

return false;
}
Expand Down
8 changes: 4 additions & 4 deletions Source/Schema.NET/bib/Chapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public partial interface IChapter : ICreativeWork
/// <summary>
/// The page on which the work ends; for example "138" or "xvi".
/// </summary>
Values<int?, string>? PageEnd { get; set; }
Values<int?, string> PageEnd { get; set; }

/// <summary>
/// The page on which the work starts; for example "135" or "xiii".
/// </summary>
Values<int?, string>? PageStart { get; set; }
Values<int?, string> PageStart { get; set; }

/// <summary>
/// Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".
Expand All @@ -42,14 +42,14 @@ public partial class Chapter : CreativeWork, IChapter
/// </summary>
[DataMember(Name = "pageEnd", Order = 206)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<int?, string>? PageEnd { get; set; }
public Values<int?, string> PageEnd { get; set; }

/// <summary>
/// The page on which the work starts; for example "135" or "xiii".
/// </summary>
[DataMember(Name = "pageStart", Order = 207)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<int?, string>? PageStart { get; set; }
public Values<int?, string> PageStart { get; set; }

/// <summary>
/// Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".
Expand Down
2 changes: 1 addition & 1 deletion Source/Schema.NET/bib/combined/AudioObjectAndBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public abstract partial class AudioObjectAndBook : MediaObject, IAudioObjectAndB
/// </summary>
[DataMember(Name = "caption", Order = 309)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<IMediaObject, string>? Caption { get; set; }
public Values<IMediaObject, string> Caption { get; set; }

/// <summary>
/// The illustrator of the book.
Expand Down
8 changes: 4 additions & 4 deletions Source/Schema.NET/core/Accommodation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial interface IAccommodation : IPlace
/// The number of rooms (excluding bathrooms and closets) of the accommodation or lodging business.
/// Typical unit code(s): ROM for room or C62 for no unit. The type of room can be put in the unitText property of the QuantitativeValue.
/// </summary>
Values<int?, IQuantitativeValue>? NumberOfRooms { get; set; }
Values<int?, IQuantitativeValue> NumberOfRooms { get; set; }

/// <summary>
/// Indications regarding the permitted usage of the accommodation.
Expand All @@ -32,7 +32,7 @@ public partial interface IAccommodation : IPlace
/// <summary>
/// Indicates whether pets are allowed to enter the accommodation or lodging business. More detailed information can be put in a text value.
/// </summary>
Values<bool?, string>? PetsAllowed { get; set; }
Values<bool?, string> PetsAllowed { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -71,7 +71,7 @@ public partial class Accommodation : Place, IAccommodation
/// </summary>
[DataMember(Name = "numberOfRooms", Order = 208)]
[JsonConverter(typeof(ValuesJsonConverter))]
public virtual Values<int?, IQuantitativeValue>? NumberOfRooms { get; set; }
public virtual Values<int?, IQuantitativeValue> NumberOfRooms { get; set; }

/// <summary>
/// Indications regarding the permitted usage of the accommodation.
Expand All @@ -85,6 +85,6 @@ public partial class Accommodation : Place, IAccommodation
/// </summary>
[DataMember(Name = "petsAllowed", Order = 210)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<bool?, string>? PetsAllowed { get; set; }
public Values<bool?, string> PetsAllowed { get; set; }
}
}
24 changes: 12 additions & 12 deletions Source/Schema.NET/core/Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public partial interface IAction : IThing
/// <summary>
/// The direct performer or driver of the action (animate or inanimate). e.g. &lt;em&gt;John&lt;/em&gt; wrote a book.
/// </summary>
Values<IOrganization, IPerson>? Agent { get; set; }
Values<IOrganization, IPerson> Agent { get; set; }

/// <summary>
/// The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to &lt;em&gt;December&lt;/em&gt;. For media, including audio and video, it's the time offset of the end of a clip within a larger file.&lt;br/&gt;&lt;br/&gt;
/// Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
/// </summary>
OneOrMany<DateTimeOffset?> EndTime { get; set; }
Values<DateTimeOffset?, TimeSpan?> EndTime { get; set; }

/// <summary>
/// For failed actions, more information on the cause of the failure.
Expand All @@ -39,7 +39,7 @@ public partial interface IAction : IThing
/// <summary>
/// The location of for example where the event is happening, an organization is located, or where an action takes place.
/// </summary>
Values<IPlace, IPostalAddress, string>? Location { get; set; }
Values<IPlace, IPostalAddress, string> Location { get; set; }

/// <summary>
/// The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). e.g. John read &lt;em&gt;a book&lt;/em&gt;.
Expand All @@ -49,7 +49,7 @@ public partial interface IAction : IThing
/// <summary>
/// Other co-agents that participated in the action indirectly. e.g. John wrote a book with &lt;em&gt;Steve&lt;/em&gt;.
/// </summary>
Values<IOrganization, IPerson>? Participant { get; set; }
Values<IOrganization, IPerson> Participant { get; set; }

/// <summary>
/// The result produced in the action. e.g. John wrote &lt;em&gt;a book&lt;/em&gt;.
Expand All @@ -60,12 +60,12 @@ public partial interface IAction : IThing
/// The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. e.g. John wrote a book from &lt;em&gt;January&lt;/em&gt; to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.&lt;br/&gt;&lt;br/&gt;
/// Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
/// </summary>
OneOrMany<DateTimeOffset?> StartTime { get; set; }
Values<DateTimeOffset?, TimeSpan?> StartTime { get; set; }

/// <summary>
/// Indicates a target EntryPoint for an Action.
/// </summary>
Values<IEntryPoint, Uri>? Target { get; set; }
Values<IEntryPoint, Uri> Target { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -93,15 +93,15 @@ public partial class Action : Thing, IAction
/// </summary>
[DataMember(Name = "agent", Order = 107)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<IOrganization, IPerson>? Agent { get; set; }
public Values<IOrganization, IPerson> Agent { get; set; }

/// <summary>
/// The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. e.g. John wrote a book from January to &lt;em&gt;December&lt;/em&gt;. For media, including audio and video, it's the time offset of the end of a clip within a larger file.&lt;br/&gt;&lt;br/&gt;
/// Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
/// </summary>
[DataMember(Name = "endTime", Order = 108)]
[JsonConverter(typeof(ValuesJsonConverter))]
public OneOrMany<DateTimeOffset?> EndTime { get; set; }
public Values<DateTimeOffset?, TimeSpan?> EndTime { get; set; }

/// <summary>
/// For failed actions, more information on the cause of the failure.
Expand All @@ -122,7 +122,7 @@ public partial class Action : Thing, IAction
/// </summary>
[DataMember(Name = "location", Order = 111)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<IPlace, IPostalAddress, string>? Location { get; set; }
public Values<IPlace, IPostalAddress, string> Location { get; set; }

/// <summary>
/// The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). e.g. John read &lt;em&gt;a book&lt;/em&gt;.
Expand All @@ -136,7 +136,7 @@ public partial class Action : Thing, IAction
/// </summary>
[DataMember(Name = "participant", Order = 113)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<IOrganization, IPerson>? Participant { get; set; }
public Values<IOrganization, IPerson> Participant { get; set; }

/// <summary>
/// The result produced in the action. e.g. John wrote &lt;em&gt;a book&lt;/em&gt;.
Expand All @@ -151,13 +151,13 @@ public partial class Action : Thing, IAction
/// </summary>
[DataMember(Name = "startTime", Order = 115)]
[JsonConverter(typeof(ValuesJsonConverter))]
public OneOrMany<DateTimeOffset?> StartTime { get; set; }
public Values<DateTimeOffset?, TimeSpan?> StartTime { get; set; }

/// <summary>
/// Indicates a target EntryPoint for an Action.
/// </summary>
[DataMember(Name = "target", Order = 116)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<IEntryPoint, Uri>? Target { get; set; }
public Values<IEntryPoint, Uri> Target { get; set; }
}
}
24 changes: 12 additions & 12 deletions Source/Schema.NET/core/ActionAccessSpecification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ public partial interface IActionAccessSpecification : IIntangible
/// <summary>
/// The end of the availability of the product or service included in the offer.
/// </summary>
OneOrMany<DateTimeOffset?> AvailabilityEnds { get; set; }
Values<int?, DateTime?, DateTimeOffset?, TimeSpan?> AvailabilityEnds { get; set; }

/// <summary>
/// The beginning of the availability of the product or service included in the offer.
/// </summary>
OneOrMany<DateTimeOffset?> AvailabilityStarts { get; set; }
Values<int?, DateTime?, DateTimeOffset?, TimeSpan?> AvailabilityStarts { get; set; }

/// <summary>
/// A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.
/// </summary>
Values<PhysicalActivityCategory?, string, IThing>? Category { get; set; }
Values<PhysicalActivityCategory?, string, IThing> Category { get; set; }

/// <summary>
/// The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid.&lt;br/&gt;&lt;br/&gt;
/// See also &lt;a class="localLink" href="http://schema.org/ineligibleRegion"&gt;ineligibleRegion&lt;/a&gt;.
/// </summary>
Values<IGeoShape, IPlace, string>? EligibleRegion { get; set; }
Values<IGeoShape, IPlace, string> EligibleRegion { get; set; }

/// <summary>
/// An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.
Expand All @@ -38,7 +38,7 @@ public partial interface IActionAccessSpecification : IIntangible
/// <summary>
/// Indicates if use of the media require a subscription (either paid or free). Allowed values are &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; (note that an earlier version had 'yes', 'no').
/// </summary>
Values<bool?, IMediaSubscription>? RequiresSubscription { get; set; }
Values<bool?, IMediaSubscription> RequiresSubscription { get; set; }
}

/// <summary>
Expand All @@ -57,30 +57,30 @@ public partial class ActionAccessSpecification : Intangible, IActionAccessSpecif
/// The end of the availability of the product or service included in the offer.
/// </summary>
[DataMember(Name = "availabilityEnds", Order = 206)]
[JsonConverter(typeof(ValuesJsonConverter))]
public OneOrMany<DateTimeOffset?> AvailabilityEnds { get; set; }
[JsonConverter(typeof(DateTimeToIso8601DateValuesJsonConverter))]
public Values<int?, DateTime?, DateTimeOffset?, TimeSpan?> AvailabilityEnds { get; set; }

/// <summary>
/// The beginning of the availability of the product or service included in the offer.
/// </summary>
[DataMember(Name = "availabilityStarts", Order = 207)]
[JsonConverter(typeof(ValuesJsonConverter))]
public OneOrMany<DateTimeOffset?> AvailabilityStarts { get; set; }
[JsonConverter(typeof(DateTimeToIso8601DateValuesJsonConverter))]
public Values<int?, DateTime?, DateTimeOffset?, TimeSpan?> AvailabilityStarts { get; set; }

/// <summary>
/// A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.
/// </summary>
[DataMember(Name = "category", Order = 208)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<PhysicalActivityCategory?, string, IThing>? Category { get; set; }
public Values<PhysicalActivityCategory?, string, IThing> Category { get; set; }

/// <summary>
/// The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is valid.&lt;br/&gt;&lt;br/&gt;
/// See also &lt;a class="localLink" href="http://schema.org/ineligibleRegion"&gt;ineligibleRegion&lt;/a&gt;.
/// </summary>
[DataMember(Name = "eligibleRegion", Order = 209)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<IGeoShape, IPlace, string>? EligibleRegion { get; set; }
public Values<IGeoShape, IPlace, string> EligibleRegion { get; set; }

/// <summary>
/// An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.
Expand All @@ -94,6 +94,6 @@ public partial class ActionAccessSpecification : Intangible, IActionAccessSpecif
/// </summary>
[DataMember(Name = "requiresSubscription", Order = 211)]
[JsonConverter(typeof(ValuesJsonConverter))]
public Values<bool?, IMediaSubscription>? RequiresSubscription { get; set; }
public Values<bool?, IMediaSubscription> RequiresSubscription { get; set; }
}
}
Loading