0% found this document useful (0 votes)
12 views

Data Container

The document defines classes and properties for parsing JSON data related to a commercial credit report. It includes classes for the header, message, report details, company addresses, credit instrument details, defaults, bounced cheques, judgements and a disclaimer. The classes contain properties annotated with JSON property attributes to map the class properties to JSON properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Data Container

The document defines classes and properties for parsing JSON data related to a commercial credit report. It includes classes for the header, message, report details, company addresses, credit instrument details, defaults, bounced cheques, judgements and a disclaimer. The classes contain properties annotated with JSON property attributes to map the class properties to JSON properties.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 24

// <auto-generated />

//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
// using CodeBeautify;
//
// var welcome5 = Welcome5.FromJson(jsonString);

namespace CodeBeautify
{
using System;
using System.Collections.Generic;

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

public partial class Welcome5


{
[JsonProperty("@xmlns:xsi")]
public Uri XmlnsXsi { get; set; }

[JsonProperty("@xsi:noNamespaceSchemaLocation")]
public string XsiNoNamespaceSchemaLocation { get; set; }

[JsonProperty("SERVICE")]
public string Service { get; set; }

[JsonProperty("ACTION")]
public string Action { get; set; }

[JsonProperty("STATUS")]
public string Status { get; set; }

[JsonProperty("HEADER")]
public Header Header { get; set; }

[JsonProperty("MESSAGE")]
public Message Message { get; set; }
}

public partial class Header


{
[JsonProperty("MEMBER_ID")]
[JsonConverter(typeof(ParseStringConverter))]
public long MemberId { get; set; }

[JsonProperty("USER_ID")]
public string UserId { get; set; }

[JsonProperty("RUN_NO")]
[JsonConverter(typeof(ParseStringConverter))]
public long RunNo { get; set; }

[JsonProperty("TOT_ITEMS")]
[JsonConverter(typeof(ParseStringConverter))]
public long TotItems { get; set; }

[JsonProperty("ERR_ITEMS")]
public object ErrItems { get; set; }
}

public partial class Message


{
[JsonProperty("ITEM")]
public Item Item { get; set; }
}

public partial class Item


{
[JsonProperty("ENQUIRY_REFERENCE")]
public string EnquiryReference { get; set; }

[JsonProperty("RSP_REPORT")]
public RspReport RspReport { get; set; }
}

public partial class RspReport


{
[JsonProperty("VERSION")]
public string Version { get; set; }

[JsonProperty("REPORT_DATE")]
public string ReportDate { get; set; }

[JsonProperty("REPORT_DATEU")]
public string ReportDateu { get; set; }

[JsonProperty("ENQUIRY_TYPE")]
public string EnquiryType { get; set; }

[JsonProperty("ENQUIRY_NUMBER")]
[JsonConverter(typeof(ParseStringConverter))]
public long EnquiryNumber { get; set; }

[JsonProperty("REFERENCE_NUMBER")]
public string ReferenceNumber { get; set; }

[JsonProperty("AMOUNT")]
public string Amount { get; set; }

[JsonProperty("GOVERNMENT_GUARANTEED")]
public string GovernmentGuaranteed { get; set; }

[JsonProperty("PRODUCT_TYPE")]
public string ProductType { get; set; }

[JsonProperty("CREDIT_FACILITY")]
public string CreditFacility { get; set; }

[JsonProperty("COMMERCIAL_SILVER")]
public CommercialSilver CommercialSilver { get; set; }
}

public partial class CommercialSilver


{
[JsonProperty("ID_DETAILS")]
public IdDetails IdDetails { get; set; }
[JsonProperty("ADDRESS_DETAILS")]
public AddressDetails AddressDetails { get; set; }

[JsonProperty("CONTACT_DETAILS")]
public ContactDetails ContactDetails { get; set; }

[JsonProperty("PREVIOUS_ENQUIRIES")]
public PreviousEnquiries PreviousEnquiries { get; set; }

[JsonProperty("L1_CI_SUMMARY")]
public L1CiSummary L1CiSummary { get; set; }

[JsonProperty("L2_CI_SUMMARY")]
public L2CiSummary L2CiSummary { get; set; }

[JsonProperty("CREDIT_INSTRUMENT_SUMMARY")]
public object CreditInstrumentSummary { get; set; }

[JsonProperty("CI_DETAILS")]
public CiDetails CiDetails { get; set; }

[JsonProperty("TRD_PAYABLES_SUMMARY")]
public object TrdPayablesSummary { get; set; }

[JsonProperty("TRD_PAYABLES_DETAILS")]
public object TrdPayablesDetails { get; set; }

[JsonProperty("NONBORROWING_LIMITS")]
public object NonborrowingLimits { get; set; }

[JsonProperty("DEFAULTS")]
public Defaults Defaults { get; set; }

[JsonProperty("COMPANY_BOUNCED_CHEQUES")]
public CompanyBouncedCheques CompanyBouncedCheques { get; set; }

[JsonProperty("KEY_STAKEHOLDERS")]
public KeyStakeholders KeyStakeholders { get; set; }

[JsonProperty("GUARANTOR_KEY_STAKEHOLDERS")]
public object GuarantorKeyStakeholders { get; set; }

[JsonProperty("CORPORATE_OWNERSHIP")]
public object CorporateOwnership { get; set; }

[JsonProperty("SHARE_CAPITAL_STRUCTURE")]
public object ShareCapitalStructure { get; set; }

[JsonProperty("COMM_JUDGEMENTS")]
public CommJudgements CommJudgements { get; set; }

[JsonProperty("PUBLIC_NOTICES")]
public object PublicNotices { get; set; }

[JsonProperty("NARRATIVES")]
public object Narratives { get; set; }

[JsonProperty("AS_NARRATIVES")]
public object AsNarratives { get; set; }

[JsonProperty("DISCLAIMER")]
public Disclaimer Disclaimer { get; set; }
}

public partial class AddressDetails


{
[JsonProperty("ADDRESS")]
public Address[] Address { get; set; }
}

public partial class Address


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("@type")]
public string Type { get; set; }

[JsonProperty("ADDRESS_LINE_1E")]
public string AddressLine1E { get; set; }

[JsonProperty("ADDRESS_LINE_1A", NullValueHandling =
NullValueHandling.Ignore)]
public TextArabic AddressLine1A { get; set; }

[JsonProperty("ADDRESS_LINE_2E")]
public string AddressLine2E { get; set; }

[JsonProperty("ADDRESS_LINE_2A", NullValueHandling =
NullValueHandling.Ignore)]
public TextArabic AddressLine2A { get; set; }

[JsonProperty("POBOX")]
[JsonConverter(typeof(ParseStringConverter))]
public long? Pobox { get; set; }

[JsonProperty("CITY")]
public string City { get; set; }

[JsonProperty("DATE_UPLOAD")]
public string DateUpload { get; set; }
}

public partial class TextArabic


{
[JsonProperty("@lang")]
public Lang Lang { get; set; }

[JsonProperty("#text")]
public string Text { get; set; }
}

public partial class CiDetails


{
[JsonProperty("MEMBER")]
public CiDetailsMember[] Member { get; set; }
}

public partial class CiDetailsMember


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("CREDITOR")]
public string Creditor { get; set; }

[JsonProperty("SHARED_CATEGORY")]
public SharedCategory SharedCategory { get; set; }
}

public partial class SharedCategory


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("LIMIT_CATEGORY")]
public string LimitCategory { get; set; }

[JsonProperty("AGGREGATE_LIMIT")]
public object AggregateLimit { get; set; }

[JsonProperty("CI_DETAIL")]
public CiDetailUnion CiDetail { get; set; }
}

public partial class CiDetailElement


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("PRODUCT_TYPE")]
public string ProductType { get; set; }

[JsonProperty("ACCOUNT_NO")]
public string AccountNo { get; set; }

[JsonProperty("CREDIT_LIMIT")]
public string CreditLimit { get; set; }

[JsonProperty("TENURE")]
[JsonConverter(typeof(ParseStringConverter))]
public long Tenure { get; set; }

[JsonProperty("INSTALMENT")]
public string Instalment { get; set; }

[JsonProperty("SECURITY_TYPE")]
public string SecurityType { get; set; }

[JsonProperty("OUTSTANDING_BALANCE")]
public string OutstandingBalance { get; set; }
[JsonProperty("LST_AMT_PAID")]
public string LstAmtPaid { get; set; }

[JsonProperty("PRV_STATEMENT_VAL")]
public string PrvStatementVal { get; set; }

[JsonProperty("PAYMENT_CODE")]
public object PaymentCode { get; set; }

[JsonProperty("ACCT_INDICATOR")]
public object AcctIndicator { get; set; }

[JsonProperty("AS_OF_DATE")]
public string AsOfDate { get; set; }

[JsonProperty("ISSUE_DATE")]
public string IssueDate { get; set; }

[JsonProperty("EXPIRY_DATE")]
public string ExpiryDate { get; set; }

[JsonProperty("CLOSED_DATE")]
public object ClosedDate { get; set; }

[JsonProperty("PRODUCT_STS")]
public string ProductSts { get; set; }

[JsonProperty("PAYMENT_FREQ")]
public object PaymentFreq { get; set; }

[JsonProperty("PAST_DUE")]
public string PastDue { get; set; }

[JsonProperty("LST_PAYMENT_DATE")]
public object LstPaymentDate { get; set; }

[JsonProperty("NXT_DUE_DATE")]
public string NxtDueDate { get; set; }

[JsonProperty("LAST_24_CYCLES")]
public string Last24_Cycles { get; set; }

[JsonProperty("GOVT_G")]
public string GovtG { get; set; }

[JsonProperty("SHARE_LIMIT_ID")]
public string ShareLimitId { get; set; }

[JsonProperty("NEW_LOAN_FROM_RESTR")]
public string NewLoanFromRestr { get; set; }

[JsonProperty("REVOLVING_LIMIT")]
public string RevolvingLimit { get; set; }

[JsonProperty("PRD_CLASS")]
public object PrdClass { get; set; }

[JsonProperty("FIN_MODE")]
public object FinMode { get; set; }
[JsonProperty("PROJECTS")]
public object Projects { get; set; }
}

public partial class CommJudgements


{
[JsonProperty("JUDGEMENT")]
public Judgement Judgement { get; set; }
}

public partial class Judgement


{
[JsonProperty("EJ_ENFORCE_DATE")]
public string EjEnforceDate { get; set; }

[JsonProperty("EJ_RES_NUMBER")]
public string EjResNumber { get; set; }

[JsonProperty("EJ_CITY")]
public string EjCity { get; set; }

[JsonProperty("EJ_COURT_CODE")]
public string EjCourtCode { get; set; }

[JsonProperty("EJ_CASE_NUMBER")]
public string EjCaseNumber { get; set; }

[JsonProperty("EJ_DATE_LOADED")]
public string EjDateLoaded { get; set; }

[JsonProperty("EJ_ORIG_CLAIM_AMT")]
public string EjOrigClaimAmt { get; set; }

[JsonProperty("EJ_CLAIM_AMT")]
public string EjClaimAmt { get; set; }

[JsonProperty("EJ_STATUS")]
public string EjStatus { get; set; }

[JsonProperty("EJ_SETTLE_DATE")]
public string EjSettleDate { get; set; }
}

public partial class CompanyBouncedCheques


{
[JsonProperty("BOUNCED_CHEQUE")]
public BouncedCheque[] BouncedCheque { get; set; }
}

public partial class BouncedCheque


{
[JsonProperty("REGISTRATION_DATE")]
public string RegistrationDate { get; set; }

[JsonProperty("REPORTING_BANK")]
public string ReportingBank { get; set; }

[JsonProperty("LOAD_DATE")]
public string LoadDate { get; set; }

[JsonProperty("REFERENCE_NUMBER")]
public string ReferenceNumber { get; set; }

[JsonProperty("AMOUNT")]
public string Amount { get; set; }

[JsonProperty("DEFAULT_STATUS")]
public string DefaultStatus { get; set; }

[JsonProperty("SETTLEMENT_DATE")]
public string SettlementDate { get; set; }

[JsonProperty("BCHQRSCD")]
public string Bchqrscd { get; set; }
}

public partial class ContactDetails


{
[JsonProperty("CONTACT")]
public Contact[] Contact { get; set; }
}

public partial class Contact


{
[JsonProperty("PHONE_TYPE")]
public string PhoneType { get; set; }

[JsonProperty("COUNTRY")]
[JsonConverter(typeof(ParseStringConverter))]
public long Country { get; set; }

[JsonProperty("PREFIX")]
[JsonConverter(typeof(ParseStringConverter))]
public long Prefix { get; set; }

[JsonProperty("NUMBER")]
[JsonConverter(typeof(ParseStringConverter))]
public long Number { get; set; }

[JsonProperty("EXTENSION")]
[JsonConverter(typeof(ParseStringConverter))]
public long? Extension { get; set; }
}

public partial class Defaults


{
[JsonProperty("DEFAULT")]
public Default[] Default { get; set; }
}

public partial class Default


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("PRODUCT_TYPE")]
public string ProductType { get; set; }

[JsonProperty("CREDITOR")]
public string Creditor { get; set; }

[JsonProperty("ACCOUNT_NO")]
public string AccountNo { get; set; }

[JsonProperty("DATE_LOADED")]
public string DateLoaded { get; set; }

[JsonProperty("ORIGINAL_AMT")]
public string OriginalAmt { get; set; }

[JsonProperty("OS_BALANCE")]
public string OsBalance { get; set; }

[JsonProperty("DEFAULT_STATUS")]
public string DefaultStatus { get; set; }

[JsonProperty("SETTLEMENT_DATE")]
public string SettlementDate { get; set; }

[JsonProperty("TRF_COLLECTION")]
public object TrfCollection { get; set; }

[JsonProperty("DPRD_CLASS")]
public object DprdClass { get; set; }

[JsonProperty("DFIN_MODE")]
public object DfinMode { get; set; }
}

public partial class Disclaimer


{
[JsonProperty("TEXT_ENGLISH")]
public string TextEnglish { get; set; }

[JsonProperty("TEXT_ARABIC")]
public TextArabic TextArabic { get; set; }
}

public partial class IdDetails


{
[JsonProperty("NAME")]
public string Name { get; set; }

[JsonProperty("NAMEU")]
public TextArabic Nameu { get; set; }

[JsonProperty("CDATE")]
public string Cdate { get; set; }

[JsonProperty("PREVIOUS_NAME")]
public string PreviousName { get; set; }

[JsonProperty("PREVIOUS_NAMEA")]
public TextArabic PreviousNamea { get; set; }
[JsonProperty("ISSUER")]
public string Issuer { get; set; }

[JsonProperty("ISSUER_DESC")]
public IssDesc[] IssuerDesc { get; set; }

[JsonProperty("IDCOD")]
[JsonConverter(typeof(ParseStringConverter))]
public long Idcod { get; set; }

[JsonProperty("ISSCIT")]
public string Isscit { get; set; }

[JsonProperty("ISSCIT_DESC")]
public IssDesc[] IsscitDesc { get; set; }

[JsonProperty("EXPDAT")]
public string Expdat { get; set; }

[JsonProperty("LEGAL_FORM")]
public string LegalForm { get; set; }

[JsonProperty("DATE_ESTABLISHED")]
public string DateEstablished { get; set; }

[JsonProperty("BUSINESS_ACTIVITY")]
public string BusinessActivity { get; set; }

[JsonProperty("WEBSITE")]
public string Website { get; set; }

[JsonProperty("NO_OF_STAFF")]
public NoOfStaff NoOfStaff { get; set; }
}

public partial class KeyStakeholders


{
[JsonProperty("KEY_STAKEHOLDER")]
public KeyStakeholder[] KeyStakeholder { get; set; }
}

public partial class KeyStakeholder


{
[JsonProperty("@type")]
public NoOfStaff Type { get; set; }

[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("NAME_E")]
public NameE NameE { get; set; }

[JsonProperty("NAME_A")]
public TextArabic NameA { get; set; }

[JsonProperty("ID_NUMBER")]
public string IdNumber { get; set; }
[JsonProperty("EXPIRY_DATE")]
public string ExpiryDate { get; set; }

[JsonProperty("DATE_OF_BIRTH")]
public string DateOfBirth { get; set; }

[JsonProperty("GENDER", NullValueHandling = NullValueHandling.Ignore)]


public Gender? Gender { get; set; }

[JsonProperty("MARITAL_STS", NullValueHandling = NullValueHandling.Ignore)]


public Gender? MaritalSts { get; set; }

[JsonProperty("NATIONALITY")]
public Nationality Nationality { get; set; }

[JsonProperty("DATE_LST_UPDATE")]
public DateLstUpdate DateLstUpdate { get; set; }

[JsonProperty("OWNERSHIP_DETAILS")]
public OwnershipDetails OwnershipDetails { get; set; }

[JsonProperty("IND_BUREAU_SUMMARY", NullValueHandling =
NullValueHandling.Ignore)]
public IndBureauSummary IndBureauSummary { get; set; }

[JsonProperty("ID_ISSUER", NullValueHandling = NullValueHandling.Ignore)]


public string IdIssuer { get; set; }

[JsonProperty("ID_CITY", NullValueHandling = NullValueHandling.Ignore)]


public string IdCity { get; set; }
}

public partial class IndBureauSummary


{
[JsonProperty("KST_IND_TXTE")]
public object KstIndTxte { get; set; }

[JsonProperty("KST_IND_TXTA")]
public KstIndTxta KstIndTxta { get; set; }

[JsonProperty("PREVIOUS_ENQUIRY_CNT")]
[JsonConverter(typeof(ParseStringConverter))]
public long PreviousEnquiryCnt { get; set; }

[JsonProperty("PREVIOUS_30DENQ_CNT")]
[JsonConverter(typeof(ParseStringConverter))]
public long Previous30DenqCnt { get; set; }

[JsonProperty("CI_COUNT")]
[JsonConverter(typeof(ParseStringConverter))]
public long CiCount { get; set; }

[JsonProperty("GURANTEED_CI_COUNT")]
[JsonConverter(typeof(ParseStringConverter))]
public long GuranteedCiCount { get; set; }

[JsonProperty("DEFAULTS_COUNT")]
[JsonConverter(typeof(ParseStringConverter))]
public long DefaultsCount { get; set; }
[JsonProperty("ISSUE_DATE")]
public IssueDate IssueDate { get; set; }

[JsonProperty("TOTAL_LIMITS")]
public string TotalLimits { get; set; }

[JsonProperty("TOTAL_GUA_LIMITS")]
public string TotalGuaLimits { get; set; }

[JsonProperty("TOTAL_LIABILITIES")]
public string TotalLiabilities { get; set; }

[JsonProperty("TOTAL_GUA_LIABILITIES")]
public string TotalGuaLiabilities { get; set; }

[JsonProperty("TOTAL_DEFAULTS")]
public TotalDefaults TotalDefaults { get; set; }

[JsonProperty("CURR_DEL_BALANCE")]
public CurrDelBalance CurrDelBalance { get; set; }
}

public partial class KstIndTxta


{
[JsonProperty("@lang")]
public Lang Lang { get; set; }
}

public partial class OwnershipDetails


{
[JsonProperty("PCT_OWNED", NullValueHandling = NullValueHandling.Ignore)]
public GurStartDate PctOwned { get; set; }

[JsonProperty("PERCENT_GUR", NullValueHandling = NullValueHandling.Ignore)]


public GurStartDate PercentGur { get; set; }

[JsonProperty("GUR_START_DATE", NullValueHandling =
NullValueHandling.Ignore)]
public GurStartDate GurStartDate { get; set; }

[JsonProperty("GUR_CLOSE_DATE", NullValueHandling =
NullValueHandling.Ignore)]
public GurCloseDate GurCloseDate { get; set; }

[JsonProperty("INFLUENTIAL", NullValueHandling = NullValueHandling.Ignore)]


public GurStartDate Influential { get; set; }
}

public partial class GurCloseDate


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }
}

public partial class GurStartDate


{
[JsonProperty("@index")]
[JsonConverter(typeof(ParseStringConverter))]
public long Index { get; set; }

[JsonProperty("#text")]
public string Text { get; set; }
}

public partial class L1CiSummary


{
[JsonProperty("MEMBER")]
public L1CiSummaryMember[] Member { get; set; }
}

public partial class L1CiSummaryMember


{
[JsonProperty("CREDITOR")]
public string Creditor { get; set; }

[JsonProperty("APPROVED_LIMIT")]
public string ApprovedLimit { get; set; }

[JsonProperty("GLOBAL_LIMIT")]
public string GlobalLimit { get; set; }

[JsonProperty("UTILISATION")]
public string Utilisation { get; set; }

[JsonProperty("UNUTILIZED_BALANCE")]
public string UnutilizedBalance { get; set; }

[JsonProperty("STATUS")]
public string Status { get; set; }

[JsonProperty("PAST_DUE")]
public string PastDue { get; set; }

[JsonProperty("COLLATERAL")]
public string Collateral { get; set; }

[JsonProperty("RELATIONSHIP_AGE")]
[JsonConverter(typeof(ParseStringConverter))]
public long RelationshipAge { get; set; }

[JsonProperty("AS_OF_DATE")]
public string AsOfDate { get; set; }
}

public partial class L2CiSummary


{
[JsonProperty("MEMBER")]
public L2CiSummaryMember[] Member { get; set; }
}

public partial class L2CiSummaryMember


{
[JsonProperty("CREDITOR")]
public string Creditor { get; set; }

[JsonProperty("FUNDED_LIMIT")]
public string FundedLimit { get; set; }

[JsonProperty("FUNDED_CAP")]
public string FundedCap { get; set; }

[JsonProperty("FUNDED_UTILISATION")]
public string FundedUtilisation { get; set; }

[JsonProperty("FUNDED_UNUTILIZED_BAL")]
public string FundedUnutilizedBal { get; set; }

[JsonProperty("NONFUNDED_LIMIT")]
public string NonfundedLimit { get; set; }

[JsonProperty("NONFUNDED_CAP")]
public string NonfundedCap { get; set; }

[JsonProperty("NONFUNDED_UTILISATION")]
public string NonfundedUtilisation { get; set; }

[JsonProperty("NONFUNDED_UNUTILIZED_BAL")]
public string NonfundedUnutilizedBal { get; set; }

[JsonProperty("SHARED_LIMIT")]
public string SharedLimit { get; set; }
}

public partial class PreviousEnquiries


{
[JsonProperty("PREV_ENQUIRY")]
public PrevEnquiry[] PrevEnquiry { get; set; }
}

public partial class PrevEnquiry


{
[JsonProperty("ENQUIRY_DATE")]
public string EnquiryDate { get; set; }

[JsonProperty("ENQUIRER")]
public string Enquirer { get; set; }

[JsonProperty("ENQUIRY_TYPE")]
public string EnquiryType { get; set; }

[JsonProperty("MEMBER_REFERENCE")]
public string MemberReference { get; set; }

[JsonProperty("PRODUCT_TYPE")]
public string ProductType { get; set; }

[JsonProperty("AMOUNT")]
public string Amount { get; set; }

[JsonProperty("NAME")]
public string Name { get; set; }
}

public enum Lang { Ar };


public enum NoOfStaff { C, I };

public enum DateLstUpdate { The01012019, The18032018, The25042018 };

public enum Gender { M, U };

public enum CurrDelBalance { The2094228, The72394228 };

public enum IssueDate { The06122011, The24082002 };

public enum TotalDefaults { The3594228, The86864228 };

public enum NameE { StakeholderName };

public enum Nationality { Oth, Sau };

public partial struct CiDetailUnion


{
public CiDetailElement CiDetailElement;
public CiDetailElement[] CiDetailElementArray;

public static implicit operator CiDetailUnion(CiDetailElement


CiDetailElement) => new CiDetailUnion { CiDetailElement = CiDetailElement };
public static implicit operator CiDetailUnion(CiDetailElement[]
CiDetailElementArray) => new CiDetailUnion { CiDetailElementArray =
CiDetailElementArray };
}

public partial struct IssDesc


{
public string String;
public TextArabic TextArabic;

public static implicit operator IssDesc(string String) => new IssDesc


{ String = String };
public static implicit operator IssDesc(TextArabic TextArabic) => new
IssDesc { TextArabic = TextArabic };
}

public partial class Welcome5


{
public static Welcome5 FromJson(string json) =>
JsonConvert.DeserializeObject<Welcome5>(json, CodeBeautify.Converter.Settings);
}

public static class Serialize


{
public static string ToJson(this Welcome5 self) =>
JsonConvert.SerializeObject(self, CodeBeautify.Converter.Settings);
}

internal static class Converter


{
public static readonly JsonSerializerSettings Settings = new
JsonSerializerSettings
{
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
DateParseHandling = DateParseHandling.None,
Converters =
{
LangConverter.Singleton,
CiDetailUnionConverter.Singleton,
IssDescConverter.Singleton,
NoOfStaffConverter.Singleton,
DateLstUpdateConverter.Singleton,
GenderConverter.Singleton,
CurrDelBalanceConverter.Singleton,
IssueDateConverter.Singleton,
TotalDefaultsConverter.Singleton,
NameEConverter.Singleton,
NationalityConverter.Singleton,
new IsoDateTimeConverter { DateTimeStyles =
DateTimeStyles.AssumeUniversal }
},
};
}

internal class ParseStringConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(long) || t ==
typeof(long?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
long l;
if (Int64.TryParse(value, out l))
{
return l;
}
throw new Exception("Cannot unmarshal type long");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (long)untypedValue;
serializer.Serialize(writer, value.ToString());
return;
}

public static readonly ParseStringConverter Singleton = new


ParseStringConverter();
}

internal class LangConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(Lang) || t ==
typeof(Lang?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
if (value == "ar")
{
return Lang.Ar;
}
throw new Exception("Cannot unmarshal type Lang");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Lang)untypedValue;
if (value == Lang.Ar)
{
serializer.Serialize(writer, "ar");
return;
}
throw new Exception("Cannot marshal type Lang");
}

public static readonly LangConverter Singleton = new LangConverter();


}

internal class CiDetailUnionConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(CiDetailUnion) || t
== typeof(CiDetailUnion?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.StartObject:
var objectValue =
serializer.Deserialize<CiDetailElement>(reader);
return new CiDetailUnion { CiDetailElement = objectValue };
case JsonToken.StartArray:
var arrayValue =
serializer.Deserialize<CiDetailElement[]>(reader);
return new CiDetailUnion { CiDetailElementArray = arrayValue };
}
throw new Exception("Cannot unmarshal type CiDetailUnion");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
var value = (CiDetailUnion)untypedValue;
if (value.CiDetailElementArray != null)
{
serializer.Serialize(writer, value.CiDetailElementArray);
return;
}
if (value.CiDetailElement != null)
{
serializer.Serialize(writer, value.CiDetailElement);
return;
}
throw new Exception("Cannot marshal type CiDetailUnion");
}

public static readonly CiDetailUnionConverter Singleton = new


CiDetailUnionConverter();
}

internal class IssDescConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(IssDesc) || t ==
typeof(IssDesc?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.String:
case JsonToken.Date:
var stringValue = serializer.Deserialize<string>(reader);
return new IssDesc { String = stringValue };
case JsonToken.StartObject:
var objectValue = serializer.Deserialize<TextArabic>(reader);
return new IssDesc { TextArabic = objectValue };
}
throw new Exception("Cannot unmarshal type IssDesc");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
var value = (IssDesc)untypedValue;
if (value.String != null)
{
serializer.Serialize(writer, value.String);
return;
}
if (value.TextArabic != null)
{
serializer.Serialize(writer, value.TextArabic);
return;
}
throw new Exception("Cannot marshal type IssDesc");
}

public static readonly IssDescConverter Singleton = new IssDescConverter();


}

internal class NoOfStaffConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(NoOfStaff) || t ==
typeof(NoOfStaff?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "C":
return NoOfStaff.C;
case "I":
return NoOfStaff.I;
}
throw new Exception("Cannot unmarshal type NoOfStaff");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (NoOfStaff)untypedValue;
switch (value)
{
case NoOfStaff.C:
serializer.Serialize(writer, "C");
return;
case NoOfStaff.I:
serializer.Serialize(writer, "I");
return;
}
throw new Exception("Cannot marshal type NoOfStaff");
}

public static readonly NoOfStaffConverter Singleton = new


NoOfStaffConverter();
}

internal class DateLstUpdateConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(DateLstUpdate) || t
== typeof(DateLstUpdate?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "01/01/2019":
return DateLstUpdate.The01012019;
case "18/03/2018":
return DateLstUpdate.The18032018;
case "25/04/2018":
return DateLstUpdate.The25042018;
}
throw new Exception("Cannot unmarshal type DateLstUpdate");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (DateLstUpdate)untypedValue;
switch (value)
{
case DateLstUpdate.The01012019:
serializer.Serialize(writer, "01/01/2019");
return;
case DateLstUpdate.The18032018:
serializer.Serialize(writer, "18/03/2018");
return;
case DateLstUpdate.The25042018:
serializer.Serialize(writer, "25/04/2018");
return;
}
throw new Exception("Cannot marshal type DateLstUpdate");
}

public static readonly DateLstUpdateConverter Singleton = new


DateLstUpdateConverter();
}

internal class GenderConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(Gender) || t ==
typeof(Gender?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "M":
return Gender.M;
case "U":
return Gender.U;
}
throw new Exception("Cannot unmarshal type Gender");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Gender)untypedValue;
switch (value)
{
case Gender.M:
serializer.Serialize(writer, "M");
return;
case Gender.U:
serializer.Serialize(writer, "U");
return;
}
throw new Exception("Cannot marshal type Gender");
}

public static readonly GenderConverter Singleton = new GenderConverter();


}

internal class CurrDelBalanceConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(CurrDelBalance) || t
== typeof(CurrDelBalance?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "20,942.28":
return CurrDelBalance.The2094228;
case "723,942.28":
return CurrDelBalance.The72394228;
}
throw new Exception("Cannot unmarshal type CurrDelBalance");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (CurrDelBalance)untypedValue;
switch (value)
{
case CurrDelBalance.The2094228:
serializer.Serialize(writer, "20,942.28");
return;
case CurrDelBalance.The72394228:
serializer.Serialize(writer, "723,942.28");
return;
}
throw new Exception("Cannot marshal type CurrDelBalance");
}
public static readonly CurrDelBalanceConverter Singleton = new
CurrDelBalanceConverter();
}

internal class IssueDateConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(IssueDate) || t ==
typeof(IssueDate?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "06/12/2011":
return IssueDate.The06122011;
case "24/08/2002":
return IssueDate.The24082002;
}
throw new Exception("Cannot unmarshal type IssueDate");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (IssueDate)untypedValue;
switch (value)
{
case IssueDate.The06122011:
serializer.Serialize(writer, "06/12/2011");
return;
case IssueDate.The24082002:
serializer.Serialize(writer, "24/08/2002");
return;
}
throw new Exception("Cannot marshal type IssueDate");
}

public static readonly IssueDateConverter Singleton = new


IssueDateConverter();
}

internal class TotalDefaultsConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(TotalDefaults) || t
== typeof(TotalDefaults?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "35,942.28":
return TotalDefaults.The3594228;
case "868,642.28":
return TotalDefaults.The86864228;
}
throw new Exception("Cannot unmarshal type TotalDefaults");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (TotalDefaults)untypedValue;
switch (value)
{
case TotalDefaults.The3594228:
serializer.Serialize(writer, "35,942.28");
return;
case TotalDefaults.The86864228:
serializer.Serialize(writer, "868,642.28");
return;
}
throw new Exception("Cannot marshal type TotalDefaults");
}

public static readonly TotalDefaultsConverter Singleton = new


TotalDefaultsConverter();
}

internal class NameEConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(NameE) || t ==
typeof(NameE?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
if (value == "stakeholder name")
{
return NameE.StakeholderName;
}
throw new Exception("Cannot unmarshal type NameE");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (NameE)untypedValue;
if (value == NameE.StakeholderName)
{
serializer.Serialize(writer, "stakeholder name");
return;
}
throw new Exception("Cannot marshal type NameE");
}

public static readonly NameEConverter Singleton = new NameEConverter();


}

internal class NationalityConverter : JsonConverter


{
public override bool CanConvert(Type t) => t == typeof(Nationality) || t ==
typeof(Nationality?);

public override object ReadJson(JsonReader reader, Type t, object


existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null) return null;
var value = serializer.Deserialize<string>(reader);
switch (value)
{
case "OTH":
return Nationality.Oth;
case "SAU":
return Nationality.Sau;
}
throw new Exception("Cannot unmarshal type Nationality");
}

public override void WriteJson(JsonWriter writer, object untypedValue,


JsonSerializer serializer)
{
if (untypedValue == null)
{
serializer.Serialize(writer, null);
return;
}
var value = (Nationality)untypedValue;
switch (value)
{
case Nationality.Oth:
serializer.Serialize(writer, "OTH");
return;
case Nationality.Sau:
serializer.Serialize(writer, "SAU");
return;
}
throw new Exception("Cannot marshal type Nationality");
}

public static readonly NationalityConverter Singleton = new


NationalityConverter();
}
}

You might also like