public SendRequest(string templateId, string recipientAddress, object data) { EnsureArgument.NotNullOrEmpty(templateId, "templateId"); EnsureArgument.NotNullOrEmpty(recipientAddress, "recipientAddress"); this.TemplateId = templateId; this.RecipientAddress = recipientAddress; this.Data = data; }
/// <summary> /// Prepares the current instance for use. /// </summary> /// <param name="apiKey">The API key to use when authenticating with SendWithUs.</param> /// <param name="worker">The HTTP implementation.</param> /// <param name="responseFactory">The factory used to construct response objects.</param> /// <returns>The current instance.</returns> protected virtual ConnectClientLib Initialize(string user, string password, HttpClient worker, IResponseFactory responseFactory) { EnsureArgument.NotNullOrEmpty(user, "user"); EnsureArgument.NotNullOrEmpty(password, "password"); EnsureArgument.NotNull(worker, "worker"); EnsureArgument.NotNull(responseFactory, "responseFactory"); ServicePointManager.ServerCertificateValidationCallback += ValidateRemoteCertificate; this.authInformation = this.BuildAuthenticationToken(user, password); this.WorkerDelme = worker; return(this); }