/// <summary>
        /// BlockBlob Type
        /// </summary>
        public PutBlockListRequest(StorageAccountSettings settings, string containerName, string blobName, BlockListBlockIdList data,
                                   string cacheControl    = null, string contentType           = null,
                                   string contentEncoding = null, string contentLanguage       = null, string blobContentMD5 = null,
                                   Dictionary <string, string> metadata = null, string leaseId = null)
            : base(settings)
        {
            if (!string.IsNullOrEmpty(leaseId))
            {
                Guard.ArgumentIsAGuid("leaseId", leaseId);
            }
            if (metadata != null)
            {
                IdentifierValidation.EnsureNamesAreValidIdentifiers(metadata.Keys);
            }

            var dataAndHash = data.AsXmlByteArrayWithMd5Hash();

            _data = dataAndHash.XmlBytes;
            _requestContentMD5 = dataAndHash.MD5Hash;

            _containerName   = containerName;
            _blobName        = blobName;
            _contentType     = contentType;
            _contentEncoding = contentEncoding;
            _contentLanguage = contentLanguage;
            _blobContentMD5  = blobContentMD5;
            _cacheControl    = cacheControl;
            _metadata        = metadata;
            _leaseId         = leaseId;
        }
        private PutBlobRequest(StorageAccountSettings settings, string containerName, string blobName, BlobType blobType,
                               string contentType  = null, string contentEncoding = null, string contentLanguage       = null, string contentMD5 = null,
                               string cacheControl = null, Dictionary <string, string> metadata = null, string leaseId = null)
            : base(settings)
        {
            if (!string.IsNullOrEmpty(leaseId))
            {
                Guard.ArgumentIsAGuid("leaseId", leaseId);
            }
            if (null != metadata)
            {
                IdentifierValidation.EnsureNamesAreValidIdentifiers(metadata.Keys);
            }

            _containerName   = containerName;
            _blobName        = blobName;
            _blobType        = blobType;
            _contentType     = contentType;
            _contentEncoding = contentEncoding;
            _contentLanguage = contentLanguage;
            _contentMD5      = contentMD5;
            _cacheControl    = cacheControl;
            _metadata        = metadata;
            _leaseId         = leaseId;
        }
示例#3
0
        public CreateQueueRequest(StorageAccountSettings settings, string queueName, Dictionary <string, string> metadata = null)
            : base(settings)
        {
            _queueName = queueName;
            _metadata  = metadata;

            if (_metadata != null)
            {
                IdentifierValidation.EnsureNamesAreValidIdentifiers(_metadata.Select(kvp => kvp.Key));
            }
        }
        public SetBlobMetadataRequest(StorageAccountSettings settings, string containerName, string blobName, Dictionary <string, string> metadata, string leaseId = null)
            : base(settings)
        {
            Guard.ArgumentIsNotNullOrEmpty("containerName", containerName);
            Guard.ArgumentIsNotNullOrEmpty("blobName", blobName);
            Guard.ArgumentIsNotNull("metadata", metadata);
            IdentifierValidation.EnsureNamesAreValidIdentifiers(metadata.Keys);
            if (!string.IsNullOrEmpty(leaseId))
            {
                Guard.ArgumentIsAGuid("leaseId", leaseId);
            }

            _containerName = containerName;
            _blobName      = blobName;
            _leaseId       = leaseId;
            _metadata      = metadata;
        }
        public CopyBlobRequest(StorageAccountSettings settings, string containerName, string blobName, string copySource, Dictionary <string, string> metadata = null, string leaseId = null)
            : base(settings)
        {
            Guard.ArgumentIsNotNullOrEmpty("containerName", containerName);
            Guard.ArgumentIsNotNullOrEmpty("blobName", blobName);
            Guard.ArgumentIsValidAbsoluteUri("copySource", copySource);
            if (!string.IsNullOrEmpty(leaseId))
            {
                Guard.ArgumentIsAGuid("leaseId", leaseId);
            }
            if (null != metadata)
            {
                IdentifierValidation.EnsureNamesAreValidIdentifiers(metadata.Keys);
            }

            _containerName = containerName;
            _blobName      = blobName;
            _copySource    = copySource;
            _metadata      = metadata;
            _leaseId       = leaseId;
        }