using Microsoft.Kiota.Abstractions;
using Microsoft.Kiota.Abstractions.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace DDNSUpdater.APIs.Ionos.ApiClient.Models {
public class Error : ApiException, IAdditionalDataHolder, IParsable {
/// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
public IDictionary AdditionalData { get; set; }
/// The error code.
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? Code { get; set; }
#nullable restore
#else
public string Code { get; set; }
#endif
/// The error message.
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
#nullable enable
public string? MessageEscaped { get; set; }
#nullable restore
#else
public string MessageEscaped { get; set; }
#endif
///
/// Instantiates a new Error and sets the default values.
///
public Error() {
AdditionalData = new Dictionary();
}
///
/// Creates a new instance of the appropriate class based on discriminator value
///
/// The parse node to use to read the discriminator value and create the object
public static Error CreateFromDiscriminatorValue(IParseNode parseNode) {
_ = parseNode ?? throw new ArgumentNullException(nameof(parseNode));
return new Error();
}
///
/// The deserialization information for the current model
///
public IDictionary> GetFieldDeserializers() {
return new Dictionary> {
{"code", n => { Code = n.GetStringValue(); } },
{"message", n => { MessageEscaped = n.GetStringValue(); } },
};
}
///
/// Serializes information the current object
///
/// Serialization writer to use to serialize this model
public void Serialize(ISerializationWriter writer) {
_ = writer ?? throw new ArgumentNullException(nameof(writer));
writer.WriteStringValue("code", Code);
writer.WriteStringValue("message", MessageEscaped);
writer.WriteAdditionalData(AdditionalData);
}
}
}