using System.Runtime.Serialization;
using Newtonsoft.Json.Converters;
namespace AMWD.Net.Api.Cloudflare
{
///
/// An audit log entry.
/// Source
///
public class AuditLog
{
///
/// A string that uniquely identifies the audit log.
///
[JsonProperty("id")]
public string? Id { get; set; }
///
/// The action that was performed.
///
[JsonProperty("action")]
public AuditLogAction? Action { get; set; }
///
/// The actor that performed the action.
///
[JsonProperty("actor")]
public AuditLogActor? Actor { get; set; }
///
/// The source of the event.
///
[JsonProperty("interface")]
public string? Interface { get; set; }
///
/// An object which can lend more context to the action being logged.
/// This is a flexible value and varies between different actions.
///
[JsonProperty("metadata")]
public object? MetaData { get; set; }
///
/// The new value of the resource that was modified.
///
[JsonProperty("newValue")]
public string? NewValue { get; set; }
///
/// The value of the resource before it was modified.
///
[JsonProperty("oldValue")]
public string? OldValue { get; set; }
///
/// The owner of the resource that was modified.
///
[JsonProperty("owner")]
public AuditLogOwner? Owner { get; set; }
///
/// The resource that was modified.
///
[JsonProperty("resource")]
public AuditLogResource? Resource { get; set; }
///
/// A UTC RFC3339 timestamp that specifies when the action being logged occured.
///
[JsonProperty("when")]
public DateTime? When { get; set; }
}
///
/// The action that was performed.
/// Soruce
///
public class AuditLogAction
{
///
/// A boolean that indicates if the action attempted was successful.
///
[JsonProperty("result")]
public bool? Result { get; set; }
///
/// A short string that describes the action that was performed.
///
[JsonProperty("type")]
public string? Type { get; set; }
}
///
/// The actor that performed the action.
/// Source
///
public class AuditLogActor
{
///
/// The ID of the actor that performed the action.
/// If a user performed the action, this will be the user's ID.
///
[JsonProperty("id")]
public string? Id { get; set; }
///
/// The email of the user that performed the action.
///
[JsonProperty("email")]
public string? Email { get; set; }
///
/// The IP address of the request that performed the action.
///
[JsonProperty("ip")]
public string? IpAddress { get; set; }
///
/// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
///
[JsonProperty("type")]
public AuditLogActorType? Type { get; set; }
}
///
/// The type of actor.
/// Source
///
[JsonConverter(typeof(StringEnumConverter))]
public enum AuditLogActorType
{
///
/// User interaction.
///
[EnumMember(Value = "user")]
User = 1,
///
/// Cloudflare admin interaction.
///
[EnumMember(Value = "admin")]
Admin = 2,
///
/// Cloudflare automated system interaction.
///
[EnumMember(Value = "Cloudflare")]
Cloudflare = 3
}
///
/// The owner of the resource that was modified.
/// Source
///
public class AuditLogOwner
{
///
/// Identifier.
///
[JsonProperty("id")]
public string? Id { get; set; }
}
///
/// The resource that was modified.
/// Source
///
public class AuditLogResource
{
///
/// An identifier for the resource that was affected by the action.
///
[JsonProperty("id")]
public string? Id { get; set; }
///
/// A short string that describes the resource that was affected by the action.
///
[JsonProperty("type")]
public string? Type { get; set; }
}
}