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 { /// /// ErrorResponseBody model /// MUST use the same status code in the actual HTTP response. /// A human-readable explanation specific to this occurrence of the problem. Ought to focus on helping the client correct the problem, rather than giving debugging information. /// SHOULD be the same as the recommended HTTP status phrase for that code. /// Machine readable list of individual errors. /// [Preserve] [DataContract(Name = "ErrorResponseBody")] public class ErrorResponseBody { /// /// Creates an instance of ErrorResponseBody. /// /// MUST use the same status code in the actual HTTP response. /// A human-readable explanation specific to this occurrence of the problem. Ought to focus on helping the client correct the problem, rather than giving debugging information. /// SHOULD be the same as the recommended HTTP status phrase for that code. /// Machine readable list of individual errors. [Preserve] public ErrorResponseBody(int status, string detail, string title, List details = default) { Status = status; Detail = detail; Title = title; Details = details; } /// /// MUST use the same status code in the actual HTTP response. /// [Preserve] [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] public int Status{ get; } /// /// A human-readable explanation specific to this occurrence of the problem. Ought to focus on helping the client correct the problem, rather than giving debugging information. /// [Preserve] [DataMember(Name = "detail", IsRequired = true, EmitDefaultValue = true)] public string Detail{ get; } /// /// SHOULD be the same as the recommended HTTP status phrase for that code. /// [Preserve] [DataMember(Name = "title", IsRequired = true, EmitDefaultValue = true)] public string Title{ get; } /// /// Machine readable list of individual errors. /// [Preserve] [DataMember(Name = "details", EmitDefaultValue = false)] public List Details{ get; } } }