Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlobBatchClient"/>
        /// class for the same account as the <see cref="BlobServiceClient"/>.
        /// The new <see cref="BlobBatchClient"/> uses the same request policy
        /// pipeline as the <see cref="BlobServiceClient"/>.
        /// </summary>
        /// <param name="client">The <see cref="BlobServiceClient"/>.</param>
        public BlobBatchClient(BlobServiceClient client)
        {
            Uri      = client.Uri;
            Pipeline = BlobServiceClientInternals.GetHttpPipeline(client);
            BlobClientOptions options = BlobServiceClientInternals.GetClientOptions(client);

            ClientDiagnostics = new ClientDiagnostics(options);

            // Construct a dummy pipeline for processing batch sub-operations
            // if we don't have one cached on the service
            BatchOperationPipeline = CreateBatchPipeline(
                Pipeline,
                BlobServiceClientInternals.GetAuthenticationPolicy(client),
                options.Version);
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlobBatchClient"/>
        /// class for container associated with the <see cref="BlobContainerClient"/>.
        /// The new <see cref="BlobBatchClient"/> uses the same request policy
        /// pipeline as the <see cref="BlobContainerClient"/>.
        /// </summary>
        /// <param name="client">The <see cref="BlobContainerClient"/>.</param>
        public BlobBatchClient(BlobContainerClient client)
        {
            Uri = client.Uri;
            BlobServiceClient blobServiceClient = client.GetParentBlobServiceClient();

            Pipeline = BlobServiceClientInternals.GetHttpPipeline(blobServiceClient);
            BlobClientOptions options = BlobServiceClientInternals.GetClientOptions(blobServiceClient);

            Version           = options.Version;
            ClientDiagnostics = new ClientDiagnostics(options);

            // Construct a dummy pipeline for processing batch sub-operations
            // if we don't have one cached on the service
            BatchOperationPipeline = CreateBatchPipeline(
                Pipeline,
                BlobServiceClientInternals.GetAuthenticationPolicy(blobServiceClient),
                Version);

            _isContainerScoped = true;
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlobBatchClient"/>
        /// class for the same account as the <see cref="BlobServiceClient"/>.
        /// The new <see cref="BlobBatchClient"/> uses the same request policy
        /// pipeline as the <see cref="BlobServiceClient"/>.
        /// </summary>
        /// <param name="client">The <see cref="BlobServiceClient"/>.</param>
        public BlobBatchClient(BlobServiceClient client)
        {
            _uri      = client.Uri;
            _pipeline = BlobServiceClientInternals.GetHttpPipeline(client);
            BlobClientOptions options = BlobServiceClientInternals.GetClientOptions(client);

            _version           = options.Version;
            _clientDiagnostics = new StorageClientDiagnostics(options);

            // Construct a dummy pipeline for processing batch sub-operations
            // if we don't have one cached on the service
            _batchOperationPipeline = CreateBatchPipeline(
                _pipeline,
                BlobServiceClientInternals.GetAuthenticationPolicy(client),
                _version);

            (ServiceRestClient serviceRestClient, ContainerRestClient containerRestClient) = BuildRestClients(_uri);
            _serviceRestClient   = serviceRestClient;
            _containerRestClient = containerRestClient;

            _isContainerScoped = false;
        }