using System; using System.Collections.Generic; using UnityEngine.Scripting; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace Unity.Services.Lobbies.Models { /// /// The body of an Update Lobby request. /// [Preserve] [DataContract(Name = "UpdateRequest")] public class UpdateRequest { /// /// The body of an Update Lobby request. /// /// The name of the lobby that should be displayed to users. All whitespace will be trimmed from name. /// The maximum number of players allowed in the lobby. Must be greater than or equal to the current number of players in the lobby. /// Indicates whether or not the lobby is publicly visible and will show up in query results. If the lobby is not publicly visible, the creator can share the `lobbyCode` with other users who can use it to join this lobby. /// Custom game-specific properties to add, update, or remove from the lobby (e.g. `mapName` or `gameType`). 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`. /// The id of the player to make the host of the lobby. As soon as this is updated the current host will no longer have permission to modify the lobby. [Preserve] public UpdateRequest(string name = null, int? maxPlayers = null, bool? isPrivate = null, Dictionary data = null, string hostId = null) { Name = name; MaxPlayers = maxPlayers; IsPrivate = isPrivate; Data = data; HostId = hostId; } /// /// The name of the lobby that should be displayed to users. All whitespace will be trimmed from name. /// [Preserve] [DataMember(Name = "name", EmitDefaultValue = false)] public string Name{ get; } /// /// The maximum number of players allowed in the lobby. Must be greater than or equal to the current number of players in the lobby. /// [Preserve] [DataMember(Name = "maxPlayers", EmitDefaultValue = false)] public int? MaxPlayers{ get; } /// /// Indicates whether or not the lobby is publicly visible and will show up in query results. If the lobby is not publicly visible, the creator can share the `lobbyCode` with other users who can use it to join this lobby. /// [Preserve] [DataMember(Name = "isPrivate", EmitDefaultValue = true)] public bool? IsPrivate{ get; } /// /// Custom game-specific properties to add, update, or remove from the lobby (e.g. `mapName` or `gameType`). 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] [DataMember(Name = "data", EmitDefaultValue = false)] public Dictionary Data{ get; } /// /// The id of the player to make the host of the lobby. As soon as this is updated the current host will no longer have permission to modify the lobby. /// [Preserve] [DataMember(Name = "hostId", EmitDefaultValue = false)] public string HostId{ get; } } }