/* Options: Date: 2024-10-18 05:18:45 SwiftVersion: 5.0 Version: 6.50 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://clubready.com/api/current //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: WalletTokenCreateEndpoint.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/sales/wallet/wallettokencreate", "GET") public class WalletTokenCreateEndpoint : WalletTokenCreateRequestDto, IReturn, IRestrictedApiRequest { public typealias Return = WalletTokenCreateResponse /** * Api Key - grants access to resources */ // @ApiMember(DataType="string", Description="Api Key - grants access to resources", IsRequired=true, Name="ApiKey", ParameterType="query") public var apiKey:String /** * ID # of the owner to create the URL for */ // @ApiMember(DataType="integer", Description="ID # of the owner to create the URL for", IsRequired=true, Name="OwnerId", ParameterType="query") public var ownerId:Int /** * Type of owner to create the URL for */ // @ApiMember(Description="Type of owner to create the URL for", IsRequired=true, Name="OwnerType", ParameterType="query") public var ownerType:OwnerType /** * Person creating the profile. Can be same as OwnerId. */ // @ApiMember(Description="Person creating the profile. Can be same as OwnerId.", IsRequired=true, Name="CreatorId", ParameterType="query") public var creatorId:Int /** * Page to display when calling the Payment Profile iFrame */ // @ApiMember(Description="Page to display when calling the Payment Profile iFrame", IsRequired=true, Name="Page", ParameterType="query") public var page:WalletPage /** * CSS Theme */ // @ApiMember(Description="CSS Theme", ParameterType="query") public var theme:String public var restrictedId:Int? public var restrictedResourceType:RestrictedResourceType /** * Allows for a payment profile to be deleted */ // @ApiMember(Description="Allows for a payment profile to be deleted", Name="AllowDeleteProfile", ParameterType="query") public var allowDeleteProfile:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case apiKey case ownerId case ownerType case creatorId case page case theme case restrictedId case restrictedResourceType case allowDeleteProfile } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) apiKey = try container.decodeIfPresent(String.self, forKey: .apiKey) ownerId = try container.decodeIfPresent(Int.self, forKey: .ownerId) ownerType = try container.decodeIfPresent(OwnerType.self, forKey: .ownerType) creatorId = try container.decodeIfPresent(Int.self, forKey: .creatorId) page = try container.decodeIfPresent(WalletPage.self, forKey: .page) theme = try container.decodeIfPresent(String.self, forKey: .theme) restrictedId = try container.decodeIfPresent(Int.self, forKey: .restrictedId) restrictedResourceType = try container.decodeIfPresent(RestrictedResourceType.self, forKey: .restrictedResourceType) allowDeleteProfile = try container.decodeIfPresent(Bool.self, forKey: .allowDeleteProfile) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if apiKey != nil { try container.encode(apiKey, forKey: .apiKey) } if ownerId != nil { try container.encode(ownerId, forKey: .ownerId) } if ownerType != nil { try container.encode(ownerType, forKey: .ownerType) } if creatorId != nil { try container.encode(creatorId, forKey: .creatorId) } if page != nil { try container.encode(page, forKey: .page) } if theme != nil { try container.encode(theme, forKey: .theme) } if restrictedId != nil { try container.encode(restrictedId, forKey: .restrictedId) } if restrictedResourceType != nil { try container.encode(restrictedResourceType, forKey: .restrictedResourceType) } if allowDeleteProfile != nil { try container.encode(allowDeleteProfile, forKey: .allowDeleteProfile) } } } public class WalletTokenCreateResponse : WalletTokenCreateResponseDto { public var success:Bool public var message:String public var walletToken:String public var walletOrigin:String public var walletUrl:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case success case message case walletToken case walletOrigin case walletUrl } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) success = try container.decodeIfPresent(Bool.self, forKey: .success) message = try container.decodeIfPresent(String.self, forKey: .message) walletToken = try container.decodeIfPresent(String.self, forKey: .walletToken) walletOrigin = try container.decodeIfPresent(String.self, forKey: .walletOrigin) walletUrl = try container.decodeIfPresent(String.self, forKey: .walletUrl) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if success != nil { try container.encode(success, forKey: .success) } if message != nil { try container.encode(message, forKey: .message) } if walletToken != nil { try container.encode(walletToken, forKey: .walletToken) } if walletOrigin != nil { try container.encode(walletOrigin, forKey: .walletOrigin) } if walletUrl != nil { try container.encode(walletUrl, forKey: .walletUrl) } } } public enum RestrictedResourceType : String, Codable { case Store case Chain case User case Undefined } public protocol IRestrictedApiRequest : IApiKeyEndpoint { var restrictedId:Int? { get set } var restrictedResourceType:RestrictedResourceType { get set } } public protocol IApiKeyEndpoint { var apiKey:String { get set } } public class ApiDtoBase : Codable { public var apiKey:String public var storeId:Int? public var chainId:Int? required public init(){} } // @DataContract public enum OwnerType : Int, Codable { case Unknown = 0 case User = 1 case ConvUser = 2 case TempCart = 3 case TempAgmt = 4 case Store = 5 case Chain = 6 case Division = 7 case District = 8 case AdminType = 9 case TempStUser = 10 case VaultApi = 11 case Company = 12 case BackOfficeStore = 13 case OrgUser = 14 case CartItem = 15 case Testing = 99 case System = 100 case Error = -1 } public enum WalletPage : String, Codable { case Uninitialized case Manage case Add case AddCard case AddBank case AddMini case AddCardMini case AddBankMini } public class WalletTokenCreateRequestDto : ApiDtoBase { public var ownerId:Int public var ownerType:OwnerType public var creatorId:Int public var page:WalletPage public var theme:String public var allowDeleteProfile:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case ownerId case ownerType case creatorId case page case theme case allowDeleteProfile } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) ownerId = try container.decodeIfPresent(Int.self, forKey: .ownerId) ownerType = try container.decodeIfPresent(OwnerType.self, forKey: .ownerType) creatorId = try container.decodeIfPresent(Int.self, forKey: .creatorId) page = try container.decodeIfPresent(WalletPage.self, forKey: .page) theme = try container.decodeIfPresent(String.self, forKey: .theme) allowDeleteProfile = try container.decodeIfPresent(Bool.self, forKey: .allowDeleteProfile) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if ownerId != nil { try container.encode(ownerId, forKey: .ownerId) } if ownerType != nil { try container.encode(ownerType, forKey: .ownerType) } if creatorId != nil { try container.encode(creatorId, forKey: .creatorId) } if page != nil { try container.encode(page, forKey: .page) } if theme != nil { try container.encode(theme, forKey: .theme) } if allowDeleteProfile != nil { try container.encode(allowDeleteProfile, forKey: .allowDeleteProfile) } } } public class WalletTokenCreateResponseDto : ApiResponseBase { public var walletToken:String public var walletOrigin:String public var walletUrl:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case walletToken case walletOrigin case walletUrl } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) walletToken = try container.decodeIfPresent(String.self, forKey: .walletToken) walletOrigin = try container.decodeIfPresent(String.self, forKey: .walletOrigin) walletUrl = try container.decodeIfPresent(String.self, forKey: .walletUrl) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if walletToken != nil { try container.encode(walletToken, forKey: .walletToken) } if walletOrigin != nil { try container.encode(walletOrigin, forKey: .walletOrigin) } if walletUrl != nil { try container.encode(walletUrl, forKey: .walletUrl) } } } public class ApiResponseBase : Codable { public var success:Bool public var message:String required public init(){} }