public string CloseJob(string jobId) { var jobInfo = new JobInfo {State = "Closed"}; var submitBatchUrl = String.Format(Urls["CloseJob"], AuthenticationClient.AuthToken.InstanceUrl, jobId); var jobResponse = BulkUploadDataToSalesforce(submitBatchUrl, jobInfo.SerializeToSalesforceXml()); return jobResponse; }
public JobInfo CreateBulkUpsertJob(JobObject jobObject, string externalIdFieldName) { var jobInfo = new JobInfo { ContentType = ContentType.XML, Operation = Operation.upsert, JobObject = jobObject, ExternalIdFieldName = externalIdFieldName }; var jobResponse = CreateJob(jobInfo); return jobResponse; }
public string UploadString(string address, string method, string data) { switch (address) { case "CreateBulkJob": var jobInfo = new JobInfo { JobId = "JobId" }; return jobInfo.SerializeToSalesforceXml(); case "UploadBatch": var batchInfo = new BatchInfo { JobId = "JobId", BatchId = "BatchId" }; return batchInfo.SerializeToSalesforceXml(); } return null; }
public string DownloadString(string address) { switch (address) { case "CloseJob": var jobInfo = new JobInfo { JobId = "JobId", State = "Completed" }; return jobInfo.SerializeToSalesforceXml(); case "GetBatchResults": return SalesforceReturnData; } return null; }
private JobInfo CreateJob(JobInfo jobInfo) { var createJobUrl = String.Format(Urls["CreateBulkJob"], AuthenticationClient.AuthToken.InstanceUrl); var xmlString = jobInfo.SerializeToSalesforceXml(); var jobResponse = BulkUploadDataToSalesforce(createJobUrl, xmlString); return jobResponse.DeSerializeToSalesforceObject<JobInfo>(); }