예제 #1
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="FileRequestChangeDetails" />
        /// class.</para>
        /// </summary>
        /// <param name="newDetails">New file request details.</param>
        /// <param name="fileRequestId">File request id. Might be missing due to historical
        /// data gap.</param>
        /// <param name="previousDetails">Previous file request details. Might be missing due
        /// to historical data gap.</param>
        public FileRequestChangeDetails(FileRequestDetails newDetails,
                                        string fileRequestId = null,
                                        FileRequestDetails previousDetails = null)
        {
            if (newDetails == null)
            {
                throw new sys.ArgumentNullException("newDetails");
            }

            if (fileRequestId != null)
            {
                if (fileRequestId.Length < 1)
                {
                    throw new sys.ArgumentOutOfRangeException("fileRequestId", "Length should be at least 1");
                }
                if (!re.Regex.IsMatch(fileRequestId, @"\A(?:[-_0-9a-zA-Z]+)\z"))
                {
                    throw new sys.ArgumentOutOfRangeException("fileRequestId", @"Value should match pattern '\A(?:[-_0-9a-zA-Z]+)\z'");
                }
            }

            this.NewDetails      = newDetails;
            this.FileRequestId   = fileRequestId;
            this.PreviousDetails = previousDetails;
        }
예제 #2
0
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="FileRequestReceiveFileDetails"
        /// /> class.</para>
        /// </summary>
        /// <param name="submittedFileNames">Submitted file names.</param>
        /// <param name="fileRequestId">File request id. Might be missing due to historical
        /// data gap.</param>
        /// <param name="fileRequestDetails">File request details. Might be missing due to
        /// historical data gap.</param>
        /// <param name="submitterName">The name as provided by the submitter. Might be missing
        /// due to historical data gap.</param>
        /// <param name="submitterEmail">The email as provided by the submitter. Might be
        /// missing due to historical data gap.</param>
        public FileRequestReceiveFileDetails(col.IEnumerable <string> submittedFileNames,
                                             string fileRequestId = null,
                                             FileRequestDetails fileRequestDetails = null,
                                             string submitterName  = null,
                                             string submitterEmail = null)
        {
            var submittedFileNamesList = enc.Util.ToList(submittedFileNames);

            if (submittedFileNames == null)
            {
                throw new sys.ArgumentNullException("submittedFileNames");
            }

            if (fileRequestId != null)
            {
                if (fileRequestId.Length < 1)
                {
                    throw new sys.ArgumentOutOfRangeException("fileRequestId", "Length should be at least 1");
                }
                if (!re.Regex.IsMatch(fileRequestId, @"\A(?:[-_0-9a-zA-Z]+)\z"))
                {
                    throw new sys.ArgumentOutOfRangeException("fileRequestId", @"Value should match pattern '\A(?:[-_0-9a-zA-Z]+)\z'");
                }
            }

            if (submitterName != null)
            {
                if (submitterName.Length < 1)
                {
                    throw new sys.ArgumentOutOfRangeException("submitterName", "Length should be at least 1");
                }
            }

            if (submitterEmail != null)
            {
                if (submitterEmail.Length > 255)
                {
                    throw new sys.ArgumentOutOfRangeException("submitterEmail", "Length should be at most 255");
                }
            }

            this.SubmittedFileNames = submittedFileNamesList;
            this.FileRequestId      = fileRequestId;
            this.FileRequestDetails = fileRequestDetails;
            this.SubmitterName      = submitterName;
            this.SubmitterEmail     = submitterEmail;
        }
        /// <summary>
        /// <para>Initializes a new instance of the <see cref="FileRequestCreateDetails" />
        /// class.</para>
        /// </summary>
        /// <param name="fileRequestId">File request id. Might be missing due to historical
        /// data gap.</param>
        /// <param name="requestDetails">File request details. Might be missing due to
        /// historical data gap.</param>
        public FileRequestCreateDetails(string fileRequestId = null,
                                        FileRequestDetails requestDetails = null)
        {
            if (fileRequestId != null)
            {
                if (fileRequestId.Length < 1)
                {
                    throw new sys.ArgumentOutOfRangeException("fileRequestId", "Length should be at least 1");
                }
                if (!re.Regex.IsMatch(fileRequestId, @"\A(?:[-_0-9a-zA-Z]+)\z"))
                {
                    throw new sys.ArgumentOutOfRangeException("fileRequestId", @"Value should match pattern '\A(?:[-_0-9a-zA-Z]+)\z'");
                }
            }

            this.FileRequestId  = fileRequestId;
            this.RequestDetails = requestDetails;
        }