Example #1
0
        public static BulkUploadRequest CreateBulkUploadRequest(ApplicationType[] applications)
        {
            var bulkUploadType = new BulkUploadType
            {
                OrgCode          = OrganisationCode,
                RequestId        = _random.Next(100000000, 999999999).ToString(),
                NoOfApplications = applications.Length,
                Applications     = applications
            };

            return(new BulkUploadRequest(bulkUploadType));
        }
 public BulkUploadJobData(JToken node) : base(node)
 {
     if (node["userId"] != null)
     {
         this._UserId = node["userId"].Value <string>();
     }
     if (node["uploadedBy"] != null)
     {
         this._UploadedBy = node["uploadedBy"].Value <string>();
     }
     if (node["conversionProfileId"] != null)
     {
         this._ConversionProfileId = ParseInt(node["conversionProfileId"].Value <string>());
     }
     if (node["resultsFileLocalPath"] != null)
     {
         this._ResultsFileLocalPath = node["resultsFileLocalPath"].Value <string>();
     }
     if (node["resultsFileUrl"] != null)
     {
         this._ResultsFileUrl = node["resultsFileUrl"].Value <string>();
     }
     if (node["numOfEntries"] != null)
     {
         this._NumOfEntries = ParseInt(node["numOfEntries"].Value <string>());
     }
     if (node["numOfObjects"] != null)
     {
         this._NumOfObjects = ParseInt(node["numOfObjects"].Value <string>());
     }
     if (node["filePath"] != null)
     {
         this._FilePath = node["filePath"].Value <string>();
     }
     if (node["bulkUploadObjectType"] != null)
     {
         this._BulkUploadObjectType = (BulkUploadObjectType)StringEnum.Parse(typeof(BulkUploadObjectType), node["bulkUploadObjectType"].Value <string>());
     }
     if (node["fileName"] != null)
     {
         this._FileName = node["fileName"].Value <string>();
     }
     if (node["objectData"] != null)
     {
         this._ObjectData = ObjectFactory.Create <BulkUploadObjectData>(node["objectData"]);
     }
     if (node["type"] != null)
     {
         this._Type = (BulkUploadType)StringEnum.Parse(typeof(BulkUploadType), node["type"].Value <string>());
     }
     if (node["emailRecipients"] != null)
     {
         this._EmailRecipients = node["emailRecipients"].Value <string>();
     }
     if (node["numOfErrorObjects"] != null)
     {
         this._NumOfErrorObjects = ParseInt(node["numOfErrorObjects"].Value <string>());
     }
     if (node["privileges"] != null)
     {
         this._Privileges = node["privileges"].Value <string>();
     }
 }
Example #3
0
 public BulkUpload(JToken node) : base(node)
 {
     if (node["id"] != null)
     {
         this._Id = ParseLong(node["id"].Value <string>());
     }
     if (node["uploadedBy"] != null)
     {
         this._UploadedBy = node["uploadedBy"].Value <string>();
     }
     if (node["uploadedByUserId"] != null)
     {
         this._UploadedByUserId = node["uploadedByUserId"].Value <string>();
     }
     if (node["uploadedOn"] != null)
     {
         this._UploadedOn = ParseInt(node["uploadedOn"].Value <string>());
     }
     if (node["numOfEntries"] != null)
     {
         this._NumOfEntries = ParseInt(node["numOfEntries"].Value <string>());
     }
     if (node["status"] != null)
     {
         this._Status = (BatchJobStatus)ParseEnum(typeof(BatchJobStatus), node["status"].Value <string>());
     }
     if (node["logFileUrl"] != null)
     {
         this._LogFileUrl = node["logFileUrl"].Value <string>();
     }
     if (node["csvFileUrl"] != null)
     {
         this._CsvFileUrl = node["csvFileUrl"].Value <string>();
     }
     if (node["bulkFileUrl"] != null)
     {
         this._BulkFileUrl = node["bulkFileUrl"].Value <string>();
     }
     if (node["bulkUploadType"] != null)
     {
         this._BulkUploadType = (BulkUploadType)StringEnum.Parse(typeof(BulkUploadType), node["bulkUploadType"].Value <string>());
     }
     if (node["results"] != null)
     {
         this._Results = new List <BulkUploadResult>();
         foreach (var arrayNode in node["results"].Children())
         {
             this._Results.Add(ObjectFactory.Create <BulkUploadResult>(arrayNode));
         }
     }
     if (node["error"] != null)
     {
         this._Error = node["error"].Value <string>();
     }
     if (node["errorType"] != null)
     {
         this._ErrorType = (BatchJobErrorTypes)ParseEnum(typeof(BatchJobErrorTypes), node["errorType"].Value <string>());
     }
     if (node["errorNumber"] != null)
     {
         this._ErrorNumber = ParseInt(node["errorNumber"].Value <string>());
     }
     if (node["fileName"] != null)
     {
         this._FileName = node["fileName"].Value <string>();
     }
     if (node["description"] != null)
     {
         this._Description = node["description"].Value <string>();
     }
     if (node["numOfObjects"] != null)
     {
         this._NumOfObjects = ParseInt(node["numOfObjects"].Value <string>());
     }
     if (node["bulkUploadObjectType"] != null)
     {
         this._BulkUploadObjectType = (BulkUploadObjectType)StringEnum.Parse(typeof(BulkUploadObjectType), node["bulkUploadObjectType"].Value <string>());
     }
 }
Example #4
0
 public static BulkUploadAddRequestBuilder Add(int conversionProfileId, Stream csvFileData, BulkUploadType bulkUploadType = null, string uploadedBy = null, string fileName = null)
 {
     return(new BulkUploadAddRequestBuilder(conversionProfileId, csvFileData, bulkUploadType, uploadedBy, fileName));
 }
Example #5
0
 public BulkUploadAddRequestBuilder(int conversionProfileId, Stream csvFileData, BulkUploadType bulkUploadType, string uploadedBy, string fileName)
     : this()
 {
     this.ConversionProfileId = conversionProfileId;
     this.CsvFileData         = csvFileData;
     this.BulkUploadType      = bulkUploadType;
     this.UploadedBy          = uploadedBy;
     this.FileName            = fileName;
 }
        public BulkUpload(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "id":
                    this._Id = ParseLong(propertyNode.InnerText);
                    continue;

                case "uploadedBy":
                    this._UploadedBy = propertyNode.InnerText;
                    continue;

                case "uploadedByUserId":
                    this._UploadedByUserId = propertyNode.InnerText;
                    continue;

                case "uploadedOn":
                    this._UploadedOn = ParseInt(propertyNode.InnerText);
                    continue;

                case "numOfEntries":
                    this._NumOfEntries = ParseInt(propertyNode.InnerText);
                    continue;

                case "status":
                    this._Status = (BatchJobStatus)ParseEnum(typeof(BatchJobStatus), propertyNode.InnerText);
                    continue;

                case "logFileUrl":
                    this._LogFileUrl = propertyNode.InnerText;
                    continue;

                case "csvFileUrl":
                    this._CsvFileUrl = propertyNode.InnerText;
                    continue;

                case "bulkFileUrl":
                    this._BulkFileUrl = propertyNode.InnerText;
                    continue;

                case "bulkUploadType":
                    this._BulkUploadType = (BulkUploadType)StringEnum.Parse(typeof(BulkUploadType), propertyNode.InnerText);
                    continue;

                case "results":
                    this._Results = new List <BulkUploadResult>();
                    foreach (XmlElement arrayNode in propertyNode.ChildNodes)
                    {
                        this._Results.Add(ObjectFactory.Create <BulkUploadResult>(arrayNode));
                    }
                    continue;

                case "error":
                    this._Error = propertyNode.InnerText;
                    continue;

                case "errorType":
                    this._ErrorType = (BatchJobErrorTypes)ParseEnum(typeof(BatchJobErrorTypes), propertyNode.InnerText);
                    continue;

                case "errorNumber":
                    this._ErrorNumber = ParseInt(propertyNode.InnerText);
                    continue;

                case "fileName":
                    this._FileName = propertyNode.InnerText;
                    continue;

                case "description":
                    this._Description = propertyNode.InnerText;
                    continue;

                case "numOfObjects":
                    this._NumOfObjects = ParseInt(propertyNode.InnerText);
                    continue;

                case "bulkUploadObjectType":
                    this._BulkUploadObjectType = (BulkUploadObjectType)StringEnum.Parse(typeof(BulkUploadObjectType), propertyNode.InnerText);
                    continue;
                }
            }
        }
Example #7
0
        public BulkUploadJobData(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "userId":
                    this._UserId = propertyNode.InnerText;
                    continue;

                case "uploadedBy":
                    this._UploadedBy = propertyNode.InnerText;
                    continue;

                case "conversionProfileId":
                    this._ConversionProfileId = ParseInt(propertyNode.InnerText);
                    continue;

                case "resultsFileLocalPath":
                    this._ResultsFileLocalPath = propertyNode.InnerText;
                    continue;

                case "resultsFileUrl":
                    this._ResultsFileUrl = propertyNode.InnerText;
                    continue;

                case "numOfEntries":
                    this._NumOfEntries = ParseInt(propertyNode.InnerText);
                    continue;

                case "numOfObjects":
                    this._NumOfObjects = ParseInt(propertyNode.InnerText);
                    continue;

                case "filePath":
                    this._FilePath = propertyNode.InnerText;
                    continue;

                case "bulkUploadObjectType":
                    this._BulkUploadObjectType = (BulkUploadObjectType)StringEnum.Parse(typeof(BulkUploadObjectType), propertyNode.InnerText);
                    continue;

                case "fileName":
                    this._FileName = propertyNode.InnerText;
                    continue;

                case "objectData":
                    this._ObjectData = ObjectFactory.Create <BulkUploadObjectData>(propertyNode);
                    continue;

                case "type":
                    this._Type = (BulkUploadType)StringEnum.Parse(typeof(BulkUploadType), propertyNode.InnerText);
                    continue;

                case "emailRecipients":
                    this._EmailRecipients = propertyNode.InnerText;
                    continue;

                case "numOfErrorObjects":
                    this._NumOfErrorObjects = ParseInt(propertyNode.InnerText);
                    continue;
                }
            }
        }