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
{
///
/// Custom data property for a lobby.
/// The value of the custom property. This property can be set to null or empty string. If this property is indexed (by setting the `index` field) then the length of the value must be less than 128 bytes.
/// Indicates for whom the property should be visible. If `public`, the property will be visible to everyone and will be included in query results. If `member` the data will only be visible to users who are members of the lobby (i.e. those who have successfully joined). If `private`, the metadata will only be visible to the host.
/// The name of the column to index this property value under, either `S#` for strings or `N#` for numeric values. If an index is specified on a property, then you can use that index name in a `QueryFilter` to filter results by that property. If You will not be prevented from indexing multiple objects having properties different with names but the same the same index, but you will likely receive unexpected results from a query.
///
[Preserve]
[DataContract(Name = "DataObject")]
public class DataObject
{
///
/// Custom data property for a lobby.
///
/// Indicates for whom the property should be visible. If `public`, the property will be visible to everyone and will be included in query results. If `member` the data will only be visible to users who are members of the lobby (i.e. those who have successfully joined). If `private`, the metadata will only be visible to the host.
/// The value of the custom property. This property can be set to null or empty string. If this property is indexed (by setting the `index` field) then the length of the value must be less than 128 bytes.
/// The name of the column to index this property value under, either `S#` for strings or `N#` for numeric values. If an index is specified on a property, then you can use that index name in a `QueryFilter` to filter results by that property. If You will not be prevented from indexing multiple objects having properties different with names but the same the same index, but you will likely receive unexpected results from a query.
[Preserve]
public DataObject(VisibilityOptions visibility, string value = default, IndexOptions index = default)
{
Value = value;
Visibility = visibility;
Index = index;
}
///
/// The value of the custom property. This property can be set to null or empty string. If this property is indexed (by setting the `index` field) then the length of the value must be less than 128 bytes.
///
[Preserve]
[DataMember(Name = "value", EmitDefaultValue = false)]
public string Value{ get; }
///
/// Indicates for whom the property should be visible. If `public`, the property will be visible to everyone and will be included in query results. If `member` the data will only be visible to users who are members of the lobby (i.e. those who have successfully joined). If `private`, the metadata will only be visible to the host.
///
[Preserve]
[JsonConverter(typeof(StringEnumConverter))]
[DataMember(Name = "visibility", IsRequired = true, EmitDefaultValue = true)]
public VisibilityOptions Visibility{ get; }
///
/// The name of the column to index this property value under, either `S#` for strings or `N#` for numeric values. If an index is specified on a property, then you can use that index name in a `QueryFilter` to filter results by that property. If You will not be prevented from indexing multiple objects having properties different with names but the same the same index, but you will likely receive unexpected results from a query.
///
[Preserve]
[JsonConverter(typeof(StringEnumConverter))]
[DataMember(Name = "index", EmitDefaultValue = false)]
public IndexOptions Index{ get; }
///
/// Indicates for whom the property should be visible. If `public`, the property will be visible to everyone and will be included in query results. If `member` the data will only be visible to users who are members of the lobby (i.e. those who have successfully joined). If `private`, the metadata will only be visible to the host.
///
/// Indicates for whom the property should be visible. If `public`, the property will be visible to everyone and will be included in query results. If `member` the data will only be visible to users who are members of the lobby (i.e. those who have successfully joined). If `private`, the metadata will only be visible to the host.
[Preserve]
[JsonConverter(typeof(StringEnumConverter))]
public enum VisibilityOptions
{
///
/// Enum Public for value: public
///
[EnumMember(Value = "public")]
Public = 1,
///
/// Enum Member for value: member
///
[EnumMember(Value = "member")]
Member = 2,
///
/// Enum Private for value: private
///
[EnumMember(Value = "private")]
Private = 3
}
///
/// The name of the column to index this property value under, either `S#` for strings or `N#` for numeric values. If an index is specified on a property, then you can use that index name in a `QueryFilter` to filter results by that property. If You will not be prevented from indexing multiple objects having properties different with names but the same the same index, but you will likely receive unexpected results from a query.
///
/// The name of the column to index this property value under, either `S#` for strings or `N#` for numeric values. If an index is specified on a property, then you can use that index name in a `QueryFilter` to filter results by that property. If You will not be prevented from indexing multiple objects having properties different with names but the same the same index, but you will likely receive unexpected results from a query.
[Preserve]
[JsonConverter(typeof(StringEnumConverter))]
public enum IndexOptions
{
///
/// Enum S1 for value: S1
///
[EnumMember(Value = "S1")]
S1 = 1,
///
/// Enum S2 for value: S2
///
[EnumMember(Value = "S2")]
S2 = 2,
///
/// Enum S3 for value: S3
///
[EnumMember(Value = "S3")]
S3 = 3,
///
/// Enum S4 for value: S4
///
[EnumMember(Value = "S4")]
S4 = 4,
///
/// Enum S5 for value: S5
///
[EnumMember(Value = "S5")]
S5 = 5,
///
/// Enum N1 for value: N1
///
[EnumMember(Value = "N1")]
N1 = 6,
///
/// Enum N2 for value: N2
///
[EnumMember(Value = "N2")]
N2 = 7,
///
/// Enum N3 for value: N3
///
[EnumMember(Value = "N3")]
N3 = 8,
///
/// Enum N4 for value: N4
///
[EnumMember(Value = "N4")]
N4 = 9,
///
/// Enum N5 for value: N5
///
[EnumMember(Value = "N5")]
N5 = 10
}
}
}