public SerwerSms(string username, string password, ResponseFormat format = ResponseFormat.Json, string apiUrl = "http://s1api2.serwersms.pl/", ILogger logger = null) { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { throw new ArgumentException("Brak danych: username, password"); } _logger = logger; _username = username; _password = password; _format = format == ResponseFormat.Json ? "json" : "xml"; _apiUrl = apiUrl; Messages = new Messages(this); Files = new Files(this); Blacklist = new Blacklist(this); Error = new Errors(this); Phones = new Phones(this); Stats = new Stats(this); Account = new Account(this); Contacts = new Contacts(this); Groups = new Groups(this); Payments = new Payments(this); Senders = new Senders(this); Premium = new Premium(this); Templates = new Templates(this); Subaccounts = new Subaccounts(this); }
public SerwerSMS(String username, String password) { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { throw new Exception("Brak danych"); } this.username = username; this.password = password; this.messages = new Messages(this); this.files = new Files(this); this.blacklist = new Blacklist(this); this.error = new Errors(this); this.phones = new Phones(this); this.stats = new Stats(this); this.account = new Account(this); this.contacts = new Contacts(this); this.groups = new Groups(this); this.payments = new Payments(this); this.senders = new Senders(this); this.premium = new Premium(this); this.templates = new Templates(this); this.subaccounts = new Subaccounts(this); }