using System; using System.Collections.Generic; using System.Text; using System.Threading; namespace AvaskTestBed.Shared.Models { class MTDVatAuth { } // models public class User { public string CompanyId { get; set; } // ... } public class HmrcAuthAppReturn { public string access_token { get; set; } public string token_type { get; set; } // bearer public int expires_in { get; set; } // access-token, 4 hours (14400) public string scope { get; set; } // read:vat+write:vat } public class ClientAuthReturn { public string access_token { get; set; } public string token_type { get; set; } // bearer public int expires_in { get; set; } // access-token, 4 hours (14400) public string refresh_token { get; set; } // max expiry length 18 months public string scope { get; set; } // read:vat+write:vat } public class RefreshAuthReturn { public string access_token { get; set; } public string token_type { get; set; } // bearer public int expires_in { get; set; } // access-token, 4 hours (14400) public string refresh_token { get; set; } // max expiry length 18 months } public class ClientAuthCallbackGet { public string code { get; set; } // single use code public string state { get; set; } // our magic number public string error { get; set; } // error name public string error_description { get; set; } // error described public string error_code { get; set; } // error code } // request/response public class ClientAuthCallbackRequest { public ClientAuthCallbackRequest(User user, string clientId, ClientAuthCallbackGet clientAuthCallbackGet = null) { ClientAuthCallbackGet = clientAuthCallbackGet; ClientId = clientId; User = user; } public User User { get; set; } public ClientAuthCallbackGet ClientAuthCallbackGet { get; set; } public string ClientId { get; set; } } public class ClientAuthCallbackResponse { public ClientAuthCallbackResponse(ClientAuthReturn clientAuthReturn) => this.ClientAuthReturn = clientAuthReturn; public ClientAuthReturn ClientAuthReturn { get; set; } } public class ClientAuthURLRequest { public ClientAuthURLRequest(User user, string clientId) { User = user; ClientId = clientId; } public User User { get; set; } public string ClientId { get; set; } } public class ClientAuthURLResponse { public ClientAuthURLResponse(string authURL) => AuthURL = authURL; public string AuthURL { get; set; } } public class HmrcAuthAppRequest { public HmrcAuthAppRequest(User user, string clientId) { User = user; ClientId = clientId; } public User User { get; set; } public string ClientId { get; set; } } public class HmrcAuthAppResponse { public HmrcAuthAppResponse(HmrcAuthAppReturn hmrcAuthAppReturn) => this.HmrcAuthAppReturn = hmrcAuthAppReturn; public HmrcAuthAppReturn HmrcAuthAppReturn { get; set; } } }