using System; using System.Collections.Generic; using UnityEngine.Scripting; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Unity.Services.Lobbies.Http; namespace Unity.Services.Lobbies.Models { /// /// A filter for an individual field that is applied to a query. /// The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name. /// The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as `field` (e.g. `integer` for MaxPlayers, `datetime` for Created, etc.). The value for `datetime` fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the \"o\" format specifier: `return dateTime.ToString(\"o\", DateTimeFormatInfo.InvariantInfo);`. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings. /// The operator used to compare the field to the filter value. Supports `CONTAINS` (only on the `Name` field), `EQ` (Equal), `NE` (Not Equal), `LT` (Less Than), `LE` (Less Than or Equal), `GT` (Greater Than), or `GE` (Greater Than or Equal). /// [Preserve] [DataContract(Name = "QueryFilter")] public class QueryFilter { /// /// A filter for an individual field that is applied to a query. /// /// The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name. /// The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as `field` (e.g. `integer` for MaxPlayers, `datetime` for Created, etc.). The value for `datetime` fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the \"o\" format specifier: `return dateTime.ToString(\"o\", DateTimeFormatInfo.InvariantInfo);`. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings. /// The operator used to compare the field to the filter value. Supports `CONTAINS` (only on the `Name` field), `EQ` (Equal), `NE` (Not Equal), `LT` (Less Than), `LE` (Less Than or Equal), `GT` (Greater Than), or `GE` (Greater Than or Equal). [Preserve] public QueryFilter(FieldOptions field, string value, OpOptions op) { Field = field; Value = value; Op = op; } /// /// The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name. /// [Preserve] [JsonConverter(typeof(StringEnumConverter))] [DataMember(Name = "field", IsRequired = true, EmitDefaultValue = true)] public FieldOptions Field{ get; } /// /// The value to compare to the field being filtered. This value must be a string and it must be parsable as the same type as `field` (e.g. `integer` for MaxPlayers, `datetime` for Created, etc.). The value for `datetime` fields (Created, LastUpdated) must be in RFC3339 format. For example, in C# this can be achieved using the \"o\" format specifier: `return dateTime.ToString(\"o\", DateTimeFormatInfo.InvariantInfo);`. Refer to your language documentation for other methods to generate RFC3339-compatible datetime strings. /// [Preserve] [DataMember(Name = "value", IsRequired = true, EmitDefaultValue = true)] public string Value{ get; } /// /// The operator used to compare the field to the filter value. Supports `CONTAINS` (only on the `Name` field), `EQ` (Equal), `NE` (Not Equal), `LT` (Less Than), `LE` (Less Than or Equal), `GT` (Greater Than), or `GE` (Greater Than or Equal). /// [Preserve] [JsonConverter(typeof(StringEnumConverter))] [DataMember(Name = "op", IsRequired = true, EmitDefaultValue = true)] public OpOptions Op{ get; } /// /// The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name. /// /// The name of the field to filter on. For custom data fields, the name of the index must be used instead of the field name. [Preserve] [JsonConverter(typeof(StringEnumConverter))] public enum FieldOptions { /// /// Enum MaxPlayers for value: MaxPlayers /// [EnumMember(Value = "MaxPlayers")] MaxPlayers = 1, /// /// Enum AvailableSlots for value: AvailableSlots /// [EnumMember(Value = "AvailableSlots")] AvailableSlots = 2, /// /// Enum Name for value: Name /// [EnumMember(Value = "Name")] Name = 3, /// /// Enum Created for value: Created /// [EnumMember(Value = "Created")] Created = 4, /// /// Enum LastUpdated for value: LastUpdated /// [EnumMember(Value = "LastUpdated")] LastUpdated = 5, /// /// Enum S1 for value: S1 /// [EnumMember(Value = "S1")] S1 = 6, /// /// Enum S2 for value: S2 /// [EnumMember(Value = "S2")] S2 = 7, /// /// Enum S3 for value: S3 /// [EnumMember(Value = "S3")] S3 = 8, /// /// Enum S4 for value: S4 /// [EnumMember(Value = "S4")] S4 = 9, /// /// Enum S5 for value: S5 /// [EnumMember(Value = "S5")] S5 = 10, /// /// Enum N1 for value: N1 /// [EnumMember(Value = "N1")] N1 = 11, /// /// Enum N2 for value: N2 /// [EnumMember(Value = "N2")] N2 = 12, /// /// Enum N3 for value: N3 /// [EnumMember(Value = "N3")] N3 = 13, /// /// Enum N4 for value: N4 /// [EnumMember(Value = "N4")] N4 = 14, /// /// Enum N5 for value: N5 /// [EnumMember(Value = "N5")] N5 = 15 } /// /// The operator used to compare the field to the filter value. Supports `CONTAINS` (only on the `Name` field), `EQ` (Equal), `NE` (Not Equal), `LT` (Less Than), `LE` (Less Than or Equal), `GT` (Greater Than), or `GE` (Greater Than or Equal). /// /// The operator used to compare the field to the filter value. Supports `CONTAINS` (only on the `Name` field), `EQ` (Equal), `NE` (Not Equal), `LT` (Less Than), `LE` (Less Than or Equal), `GT` (Greater Than), or `GE` (Greater Than or Equal). [Preserve] [JsonConverter(typeof(StringEnumConverter))] public enum OpOptions { /// /// Enum CONTAINS for value: CONTAINS /// [EnumMember(Value = "CONTAINS")] CONTAINS = 1, /// /// Enum EQ for value: EQ /// [EnumMember(Value = "EQ")] EQ = 2, /// /// Enum NE for value: NE /// [EnumMember(Value = "NE")] NE = 3, /// /// Enum LT for value: LT /// [EnumMember(Value = "LT")] LT = 4, /// /// Enum LE for value: LE /// [EnumMember(Value = "LE")] LE = 5, /// /// Enum GT for value: GT /// [EnumMember(Value = "GT")] GT = 6, /// /// Enum GE for value: GE /// [EnumMember(Value = "GE")] GE = 7 } } }