
using System;
using System.Collections.Generic;

using System.Globalization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;


// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
//    using CodeBeautify;
//
//    var welcome1 = TicketRequest.FromJson(jsonString);

namespace PortUpdate.Models;

public partial class TicketRequest
{
    [JsonProperty("data")]
    public Data Data { get; set; }
}

public partial class Data
{
    [JsonProperty("username")]
    public string Username { get; set; }

    [JsonProperty("clustername")]
    public string Clustername { get; set; }

    [JsonProperty("ticket")]
    public string Ticket { get; set; }

    [JsonProperty("CSRFPreventionToken")]
    public string CsrfPreventionToken { get; set; }

    [JsonProperty("cap")]
    public Cap Cap { get; set; }
}

public partial class Cap
{
    [JsonProperty("mapping")]
    public Mapping Mapping { get; set; }

    [JsonProperty("nodes")]
    public System.Collections.Generic.Dictionary<string, long> Nodes { get; set; }

    [JsonProperty("storage")]
    public Storage Storage { get; set; }

    [JsonProperty("dc")]
    public System.Collections.Generic.Dictionary<string, long> Dc { get; set; }

    [JsonProperty("vms")]
    public System.Collections.Generic.Dictionary<string, long> Vms { get; set; }

    [JsonProperty("sdn")]
    public Sdn Sdn { get; set; }

    [JsonProperty("access")]
    public Access Access { get; set; }
}

public partial class Access
{
    [JsonProperty("Group.Allocate")]
    public long GroupAllocate { get; set; }

    [JsonProperty("Permissions.Modify")]
    public long PermissionsModify { get; set; }

    [JsonProperty("User.Modify")]
    public long UserModify { get; set; }
}

public partial class Mapping
{
    [JsonProperty("Mapping.Modify")]
    public long MappingModify { get; set; }

    [JsonProperty("Mapping.Use")]
    public long MappingUse { get; set; }

    [JsonProperty("Permissions.Modify")]
    public long PermissionsModify { get; set; }

    [JsonProperty("Mapping.Audit")]
    public long MappingAudit { get; set; }
}

public partial class Sdn
{
    [JsonProperty("SDN.Allocate")]
    public long SdnAllocate { get; set; }

    [JsonProperty("SDN.Audit")]
    public long SdnAudit { get; set; }

    [JsonProperty("Permissions.Modify")]
    public long PermissionsModify { get; set; }

    [JsonProperty("SDN.Use")]
    public long SdnUse { get; set; }
}

public partial class Storage
{
    [JsonProperty("Datastore.AllocateSpace")]
    public long DatastoreAllocateSpace { get; set; }

    [JsonProperty("Datastore.Audit")]
    public long DatastoreAudit { get; set; }

    [JsonProperty("Datastore.AllocateTemplate")]
    public long DatastoreAllocateTemplate { get; set; }

    [JsonProperty("Datastore.Allocate")]
    public long DatastoreAllocate { get; set; }

    [JsonProperty("Permissions.Modify")]
    public long PermissionsModify { get; set; }
}

public partial class TicketRequest
{
    public static TicketRequest? FromJson(string json) => JsonConvert.DeserializeObject<TicketRequest>(json, Converter.Settings);
}

public static class Serialize
{
    public static string ToJson(this TicketRequest self) => JsonConvert.SerializeObject(self, Converter.Settings);
}

internal static class Converter
{
    public static readonly JsonSerializerSettings? Settings = new JsonSerializerSettings
    {
        MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
        DateParseHandling = DateParseHandling.None,
        Converters =
        {
            new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
        },
    };
}

