private Silanis.ESL.API.Message CreateTypicalAPIMessage()
        {
            Silanis.ESL.API.Message apiMessage = new Silanis.ESL.API.Message();
            apiMessage.Content = "Opt-out reason";
            apiMessage.Status  = Silanis.ESL.SDK.MessageStatus.READ.getApiValue();
            apiMessage.Created = DateTime.Now;

            User fromUser = new User();

            fromUser.FirstName = "John";
            fromUser.LastName  = "Smith";
            fromUser.Id        = "user1";
            fromUser.Email     = "*****@*****.**";
            apiMessage.From    = fromUser;

            User toUser = new User();

            toUser.FirstName = "Patty";
            toUser.LastName  = "Galant";
            toUser.Id        = "user2";
            toUser.Email     = "*****@*****.**";
            apiMessage.AddTo(toUser);

            return(apiMessage);
        }
Exemple #2
0
        private Silanis.ESL.API.Package CreateTypicalAPIPackage()
        {
            Silanis.ESL.API.Package apiPackage = new Silanis.ESL.API.Package();
            apiPackage.Id           = "1";
            apiPackage.Language     = "en";
            apiPackage.Autocomplete = true;
            apiPackage.Consent      = "Consent";
            apiPackage.Completed    = new DateTime?();
            apiPackage.Description  = "API document package description";
            apiPackage.Due          = new DateTime?();
            apiPackage.Name         = "API package name";
            apiPackage.Status       = Silanis.ESL.API.PackageStatus.DRAFT;

            Silanis.ESL.API.Message apiMessage = new Silanis.ESL.API.Message();
            apiMessage.Content = "opt-out reason";
            apiMessage.Status  = Silanis.ESL.API.MessageStatus.NEW;
            apiMessage.Created = DateTime.Now;
            User fromUser = new User();

            fromUser.FirstName = "John";
            fromUser.LastName  = "Smith";
            fromUser.Email     = "*****@*****.**";
            apiMessage.From    = fromUser;
            apiPackage.AddMessage(apiMessage);
            User toUser = new User();

            toUser.FirstName = "Patty";
            toUser.LastName  = "Galant";
            toUser.Email     = "*****@*****.**";
            apiMessage.AddTo(toUser);

            return(apiPackage);
        }
        public Silanis.ESL.API.Message ToAPIMessage()
        {
            if (sdkMessage == null)
            {
                return(apiMessage);
            }

            Silanis.ESL.API.Message result = new Silanis.ESL.API.Message();

            if (sdkMessage.Content != null)
            {
                result.Content = sdkMessage.Content;
            }

            if (sdkMessage.From != null)
            {
                Signer fromSigner = sdkMessage.From;
                User   fromUser   = new User();
                fromUser.Email     = fromSigner.Email;
                fromUser.FirstName = fromSigner.FirstName;
                fromUser.LastName  = fromSigner.LastName;
                fromUser.Id        = fromSigner.Id;
                fromUser.Company   = fromSigner.Company;
                fromUser.Title     = fromSigner.Title;

                result.From = fromUser;
            }

            if (sdkMessage.To != null && sdkMessage.To.Count != 0)
            {
                foreach (Signer toSigner in sdkMessage.To.Values)
                {
                    User toUser = new User();
                    toUser.Email     = toSigner.Email;
                    toUser.FirstName = toSigner.FirstName;
                    toUser.LastName  = toSigner.LastName;
                    toUser.Company   = toSigner.Company;
                    toUser.Title     = toSigner.Title;

                    result.AddTo(toUser);
                }
            }

            if (sdkMessage.Created != null)
            {
                result.Created = sdkMessage.Created;
            }


            result.Status = new MessageStatusConverter(sdkMessage.Status).ToAPIMessageStatus();

            return(result);
        }
        private Silanis.ESL.API.Message CreateTypicalAPIMessage()
        {
            Silanis.ESL.API.Message apiMessage = new Silanis.ESL.API.Message();
            apiMessage.Content = "Opt-out reason";
            apiMessage.Status = Silanis.ESL.API.MessageStatus.READ;
            apiMessage.Created = DateTime.Now;

            User fromUser = new User();
            fromUser.FirstName = "John";
            fromUser.LastName = "Smith";
            fromUser.Id = "user1";
            fromUser.Email = "*****@*****.**";
            apiMessage.From = fromUser;

            User toUser = new User();
            toUser.FirstName = "Patty";
            toUser.LastName = "Galant";
            toUser.Id = "user2";
            toUser.Email = "*****@*****.**";
            apiMessage.AddTo(toUser);

            return apiMessage;
        }
		private Silanis.ESL.API.Package CreateTypicalAPIPackage()
		{
			Silanis.ESL.API.Package apiPackage = new Silanis.ESL.API.Package();
			apiPackage.Id = "1";
			apiPackage.Language = "en";
			apiPackage.Autocomplete = true;
			apiPackage.Consent = "Consent";
			apiPackage.Completed = new DateTime?();
			apiPackage.Description = "API document package description";
			apiPackage.Due = new DateTime?();
			apiPackage.Name = "API package name";
			apiPackage.Status = Silanis.ESL.API.PackageStatus.DRAFT;

            Silanis.ESL.API.Message apiMessage = new Silanis.ESL.API.Message();
            apiMessage.Content = "opt-out reason";
            apiMessage.Status = Silanis.ESL.API.MessageStatus.NEW;
            apiMessage.Created = DateTime.Now;
            User fromUser = new User();
            fromUser.FirstName = "John";
            fromUser.LastName = "Smith";
            fromUser.Email = "*****@*****.**";
            apiMessage.From = fromUser;
            apiPackage.AddMessage(apiMessage);
            User toUser = new User();
            toUser.FirstName = "Patty";
            toUser.LastName = "Galant";
            toUser.Email = "*****@*****.**";
            apiMessage.AddTo(toUser);

			return apiPackage;
		}