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
{
///
/// The body of an Update Player Data request.
/// (TBD) Connection information for connecting to a relay with this player.
/// Custom game-specific properties to add, update, or remove from the player (e.g. `role` or `skill`). To remove an existing property, include it in `data` but set the property object to `null`. To update the value to `null`, set the `value` property of the object to `null`.
/// An id that associates this player in this lobby with a persistent connection. When a disconnect notification is recevied, this value is used to identify the associated player in a lobby to mark them as disconnected.
///
[Preserve]
[DataContract(Name = "PlayerUpdateRequest")]
public class PlayerUpdateRequest
{
///
/// The body of an Update Player Data request.
///
/// (TBD) Connection information for connecting to a relay with this player.
/// Custom game-specific properties to add, update, or remove from the player (e.g. `role` or `skill`). To remove an existing property, include it in `data` but set the property object to `null`. To update the value to `null`, set the `value` property of the object to `null`.
/// An id that associates this player in this lobby with a persistent connection. When a disconnect notification is recevied, this value is used to identify the associated player in a lobby to mark them as disconnected.
[Preserve]
public PlayerUpdateRequest(string connectionInfo = default, Dictionary data = default, string allocationId = default)
{
ConnectionInfo = connectionInfo;
Data = new JsonObject(data);
AllocationId = allocationId;
}
///
/// (TBD) Connection information for connecting to a relay with this player.
///
[Preserve]
[DataMember(Name = "connectionInfo", EmitDefaultValue = false)]
public string ConnectionInfo{ get; }
///
/// Custom game-specific properties to add, update, or remove from the player (e.g. `role` or `skill`). To remove an existing property, include it in `data` but set the property object to `null`. To update the value to `null`, set the `value` property of the object to `null`.
///
[Preserve]
[JsonConverter(typeof(JsonObjectConverter))]
[DataMember(Name = "data", EmitDefaultValue = false)]
public JsonObject Data{ get; }
///
/// An id that associates this player in this lobby with a persistent connection. When a disconnect notification is recevied, this value is used to identify the associated player in a lobby to mark them as disconnected.
///
[Preserve]
[DataMember(Name = "allocationId", EmitDefaultValue = false)]
public string AllocationId{ get; }
}
}