using System; using System.Collections.Generic; using UnityEngine.Scripting; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Unity.Services.Relay.Http; namespace Unity.Services.Relay.Models { /// /// A request to create an allocation /// Indicates the maximum number of connections that the client will allow to communicate with them. It will also be used in order to find a relay with sufficient capacity /// Indicates the region this allocation should go. If not provided, a default region will be chosen. /// [Preserve] [DataContract(Name = "AllocationRequest")] public class AllocationRequest { /// /// A request to create an allocation /// /// Indicates the maximum number of connections that the client will allow to communicate with them. It will also be used in order to find a relay with sufficient capacity /// Indicates the region this allocation should go. If not provided, a default region will be chosen. [Preserve] public AllocationRequest(int maxConnections, string region = default) { MaxConnections = maxConnections; Region = region; } /// /// Indicates the maximum number of connections that the client will allow to communicate with them. It will also be used in order to find a relay with sufficient capacity /// [Preserve] [DataMember(Name = "maxConnections", IsRequired = true, EmitDefaultValue = true)] public int MaxConnections{ get; } /// /// Indicates the region this allocation should go. If not provided, a default region will be chosen. /// [Preserve] [DataMember(Name = "region", EmitDefaultValue = false)] public string Region{ get; } } }