@azure/storage-queue 12.20.0-alpha.20230615.1 → 12.20.0-alpha.20230619.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -330,6 +330,8 @@ function ipRangeToString(ipRange) {
330
330
  }
331
331
 
332
332
  // Copyright (c) Microsoft Corporation.
333
+ // Licensed under the MIT license.
334
+ const SDK_VERSION$1 = "12.20.0";
333
335
  const SERVICE_VERSION = "2021-10-04";
334
336
  const DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;
335
337
  AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;
@@ -462,7 +464,7 @@ function extractConnectionStringParts(connectionString) {
462
464
  }
463
465
  else {
464
466
  // SAS connection string
465
- let accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
467
+ const accountSas = getValueInConnString(connectionString, "SharedAccessSignature");
466
468
  const accountName = getAccountNameFromUrl(queueEndpoint);
467
469
  if (!queueEndpoint) {
468
470
  throw new Error("Invalid QueueEndpoint in the provided SAS Connection String");
@@ -470,10 +472,6 @@ function extractConnectionStringParts(connectionString) {
470
472
  else if (!accountSas) {
471
473
  throw new Error("Invalid SharedAccessSignature in the provided SAS Connection String");
472
474
  }
473
- // remove test SAS
474
- if (accountSas === "fakeSasToken") {
475
- accountSas = "";
476
- }
477
475
  return { kind: "SASConnString", url: queueEndpoint, accountName, accountSas };
478
476
  }
479
477
  }
@@ -5031,8 +5029,7 @@ function getStorageClientContext(url, pipeline) {
5031
5029
  else if (pipelineOptions.retryOptions.tryTimeoutInMs === undefined) {
5032
5030
  pipelineOptions.retryOptions.tryTimeoutInMs = 30 * 1000;
5033
5031
  }
5034
- const coreOptions = getCoreClientOptions(pipeline);
5035
- return new StorageContextClient(url, coreOptions);
5032
+ return new StorageContextClient(url, getCoreClientOptions(pipeline));
5036
5033
  }
5037
5034
 
5038
5035
  // Copyright (c) Microsoft Corporation.
@@ -5040,8 +5037,9 @@ function getStorageClientContext(url, pipeline) {
5040
5037
  * Creates a span using the global tracer.
5041
5038
  * @internal
5042
5039
  */
5043
- const createSpan = coreTracing.createSpanFunction({
5044
- packagePrefix: "Azure.Storage.Queue",
5040
+ const tracingClient = coreTracing.createTracingClient({
5041
+ packageName: "@azure/storage-queue",
5042
+ packageVersion: SDK_VERSION$1,
5045
5043
  namespace: "Microsoft.Storage",
5046
5044
  });
5047
5045
 
@@ -5280,20 +5278,9 @@ class QueueClient extends StorageClient {
5280
5278
  * ```
5281
5279
  */
5282
5280
  async create(options = {}) {
5283
- const { span, updatedOptions } = createSpan("QueueClient-create", options);
5284
- try {
5281
+ return tracingClient.withSpan("QueueClient-create", options, async (updatedOptions) => {
5285
5282
  return assertResponse(await this.queueContext.create(updatedOptions));
5286
- }
5287
- catch (e) {
5288
- span.setStatus({
5289
- code: coreTracing.SpanStatusCode.ERROR,
5290
- message: e.message,
5291
- });
5292
- throw e;
5293
- }
5294
- finally {
5295
- span.end();
5296
- }
5283
+ });
5297
5284
  }
5298
5285
  /**
5299
5286
  * Creates a new queue under the specified account if it doesn't already exist.
@@ -5303,35 +5290,25 @@ class QueueClient extends StorageClient {
5303
5290
  * @param options -
5304
5291
  */
5305
5292
  async createIfNotExists(options = {}) {
5306
- var _a, _b;
5307
- const { span, updatedOptions } = createSpan("QueueClient-createIfNotExists", options);
5308
- try {
5309
- const response = await this.create(updatedOptions);
5310
- // When a queue with the specified name already exists, the Queue service checks the metadata associated with the existing queue.
5311
- // If the existing metadata is identical to the metadata specified on the Create Queue request, status code 204 (No Content) is returned.
5312
- // If the existing metadata does not match, the operation fails and status code 409 (Conflict) is returned.
5313
- if (response._response.status === 204) {
5314
- return Object.assign({ succeeded: false }, response);
5293
+ return tracingClient.withSpan("QueueClient-createIfNotExists", options, async (updatedOptions) => {
5294
+ var _a, _b;
5295
+ try {
5296
+ const response = await this.create(updatedOptions);
5297
+ // When a queue with the specified name already exists, the Queue service checks the metadata associated with the existing queue.
5298
+ // If the existing metadata is identical to the metadata specified on the Create Queue request, status code 204 (No Content) is returned.
5299
+ // If the existing metadata does not match, the operation fails and status code 409 (Conflict) is returned.
5300
+ if (response._response.status === 204) {
5301
+ return Object.assign({ succeeded: false }, response);
5302
+ }
5303
+ return Object.assign({ succeeded: true }, response);
5315
5304
  }
5316
- return Object.assign({ succeeded: true }, response);
5317
- }
5318
- catch (e) {
5319
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "QueueAlreadyExists") {
5320
- span.setStatus({
5321
- code: coreTracing.SpanStatusCode.ERROR,
5322
- message: "Expected exception when creating a queue only if it does not already exist.",
5323
- });
5324
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
5305
+ catch (e) {
5306
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "QueueAlreadyExists") {
5307
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
5308
+ }
5309
+ throw e;
5325
5310
  }
5326
- span.setStatus({
5327
- code: coreTracing.SpanStatusCode.ERROR,
5328
- message: e.message,
5329
- });
5330
- throw e;
5331
- }
5332
- finally {
5333
- span.end();
5334
- }
5311
+ });
5335
5312
  }
5336
5313
  /**
5337
5314
  * Deletes the specified queue permanently if it exists.
@@ -5340,29 +5317,19 @@ class QueueClient extends StorageClient {
5340
5317
  * @param options -
5341
5318
  */
5342
5319
  async deleteIfExists(options = {}) {
5343
- var _a, _b;
5344
- const { span, updatedOptions } = createSpan("QueueClient-deleteIfExists", options);
5345
- try {
5346
- const res = await this.delete(updatedOptions);
5347
- return Object.assign({ succeeded: true }, res);
5348
- }
5349
- catch (e) {
5350
- if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "QueueNotFound") {
5351
- span.setStatus({
5352
- code: coreTracing.SpanStatusCode.ERROR,
5353
- message: "Expected exception when deleting a queue only if it exists.",
5354
- });
5355
- return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
5320
+ return tracingClient.withSpan("QueueClient-deleteIfExists", options, async (updatedOptions) => {
5321
+ var _a, _b;
5322
+ try {
5323
+ const res = await this.delete(updatedOptions);
5324
+ return Object.assign({ succeeded: true }, res);
5356
5325
  }
5357
- span.setStatus({
5358
- code: coreTracing.SpanStatusCode.ERROR,
5359
- message: e.message,
5360
- });
5361
- throw e;
5362
- }
5363
- finally {
5364
- span.end();
5365
- }
5326
+ catch (e) {
5327
+ if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "QueueNotFound") {
5328
+ return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });
5329
+ }
5330
+ throw e;
5331
+ }
5332
+ });
5366
5333
  }
5367
5334
  /**
5368
5335
  * Deletes the specified queue permanently.
@@ -5381,23 +5348,12 @@ class QueueClient extends StorageClient {
5381
5348
  * ```
5382
5349
  */
5383
5350
  async delete(options = {}) {
5384
- const { span, updatedOptions } = createSpan("QueueClient-delete", options);
5385
- try {
5351
+ return tracingClient.withSpan("QueueClient-delete", options, async (updatedOptions) => {
5386
5352
  return assertResponse(await this.queueContext.delete({
5387
5353
  abortSignal: options.abortSignal,
5388
5354
  tracingOptions: updatedOptions.tracingOptions,
5389
5355
  }));
5390
- }
5391
- catch (e) {
5392
- span.setStatus({
5393
- code: coreTracing.SpanStatusCode.ERROR,
5394
- message: e.message,
5395
- });
5396
- throw e;
5397
- }
5398
- finally {
5399
- span.end();
5400
- }
5356
+ });
5401
5357
  }
5402
5358
  /**
5403
5359
  * Returns true if the specified queue exists; false otherwise.
@@ -5409,31 +5365,18 @@ class QueueClient extends StorageClient {
5409
5365
  * @param options - options to Exists operation.
5410
5366
  */
5411
5367
  async exists(options = {}) {
5412
- const { span, updatedOptions } = createSpan("QueueClient-exists", options);
5413
- try {
5414
- await this.getProperties({
5415
- abortSignal: options.abortSignal,
5416
- tracingOptions: updatedOptions.tracingOptions,
5417
- });
5418
- return true;
5419
- }
5420
- catch (e) {
5421
- if (e.statusCode === 404) {
5422
- span.setStatus({
5423
- code: coreTracing.SpanStatusCode.ERROR,
5424
- message: "Expected exception when checking queue existence",
5425
- });
5426
- return false;
5368
+ return tracingClient.withSpan("QueueClient-exists", options, async (updatedOptions) => {
5369
+ try {
5370
+ await this.getProperties(updatedOptions);
5371
+ return true;
5427
5372
  }
5428
- span.setStatus({
5429
- code: coreTracing.SpanStatusCode.ERROR,
5430
- message: e.message,
5431
- });
5432
- throw e;
5433
- }
5434
- finally {
5435
- span.end();
5436
- }
5373
+ catch (e) {
5374
+ if (e.statusCode === 404) {
5375
+ return false;
5376
+ }
5377
+ throw e;
5378
+ }
5379
+ });
5437
5380
  }
5438
5381
  /**
5439
5382
  * Gets all user-defined metadata and system properties for the specified
@@ -5449,23 +5392,9 @@ class QueueClient extends StorageClient {
5449
5392
  * @returns Response data for the Queue get properties operation.
5450
5393
  */
5451
5394
  async getProperties(options = {}) {
5452
- const { span, updatedOptions } = createSpan("QueueClient-getProperties", options);
5453
- try {
5454
- return assertResponse(await this.queueContext.getProperties({
5455
- abortSignal: options.abortSignal,
5456
- tracingOptions: updatedOptions.tracingOptions,
5457
- }));
5458
- }
5459
- catch (e) {
5460
- span.setStatus({
5461
- code: coreTracing.SpanStatusCode.ERROR,
5462
- message: e.message,
5463
- });
5464
- throw e;
5465
- }
5466
- finally {
5467
- span.end();
5468
- }
5395
+ return tracingClient.withSpan("QueueClient-getProperties", options, async (updatedOptions) => {
5396
+ return assertResponse(await this.queueContext.getProperties(updatedOptions));
5397
+ });
5469
5398
  }
5470
5399
  /**
5471
5400
  * Sets one or more user-defined name-value pairs for the specified queue.
@@ -5479,24 +5408,9 @@ class QueueClient extends StorageClient {
5479
5408
  * @returns Response data for the Queue set metadata operation.
5480
5409
  */
5481
5410
  async setMetadata(metadata, options = {}) {
5482
- const { span, updatedOptions } = createSpan("QueueClient-setMetadata", options);
5483
- try {
5484
- return assertResponse(await this.queueContext.setMetadata({
5485
- abortSignal: options.abortSignal,
5486
- metadata,
5487
- tracingOptions: updatedOptions.tracingOptions,
5488
- }));
5489
- }
5490
- catch (e) {
5491
- span.setStatus({
5492
- code: coreTracing.SpanStatusCode.ERROR,
5493
- message: e.message,
5494
- });
5495
- throw e;
5496
- }
5497
- finally {
5498
- span.end();
5499
- }
5411
+ return tracingClient.withSpan("QueueClient-setMetadata", options, async (updatedOptions) => {
5412
+ return assertResponse(await this.queueContext.setMetadata(Object.assign(Object.assign({}, updatedOptions), { metadata })));
5413
+ });
5500
5414
  }
5501
5415
  /**
5502
5416
  * Gets details about any stored access policies specified on the queue that may be used with Shared Access Signatures.
@@ -5510,8 +5424,7 @@ class QueueClient extends StorageClient {
5510
5424
  * @returns Response data for the Queue get access policy operation.
5511
5425
  */
5512
5426
  async getAccessPolicy(options = {}) {
5513
- const { span, updatedOptions } = createSpan("QueueClient-getAccessPolicy", options);
5514
- try {
5427
+ return tracingClient.withSpan("QueueClient-getAccessPolicy", options, async (updatedOptions) => {
5515
5428
  const response = assertResponse(await this.queueContext.getAccessPolicy({
5516
5429
  abortSignal: options.abortSignal,
5517
5430
  tracingOptions: updatedOptions.tracingOptions,
@@ -5544,17 +5457,7 @@ class QueueClient extends StorageClient {
5544
5457
  });
5545
5458
  }
5546
5459
  return res;
5547
- }
5548
- catch (e) {
5549
- span.setStatus({
5550
- code: coreTracing.SpanStatusCode.ERROR,
5551
- message: e.message,
5552
- });
5553
- throw e;
5554
- }
5555
- finally {
5556
- span.end();
5557
- }
5460
+ });
5558
5461
  }
5559
5462
  /**
5560
5463
  * Sets stored access policies for the queue that may be used with Shared Access Signatures.
@@ -5565,8 +5468,7 @@ class QueueClient extends StorageClient {
5565
5468
  * @returns Response data for the Queue set access policy operation.
5566
5469
  */
5567
5470
  async setAccessPolicy(queueAcl, options = {}) {
5568
- const { span, updatedOptions } = createSpan("QueueClient-setAccessPolicy", options);
5569
- try {
5471
+ return tracingClient.withSpan("QueueClient-setAccessPolicy", options, async (updatedOptions) => {
5570
5472
  const acl = [];
5571
5473
  for (const identifier of queueAcl || []) {
5572
5474
  acl.push({
@@ -5582,22 +5484,8 @@ class QueueClient extends StorageClient {
5582
5484
  id: identifier.id,
5583
5485
  });
5584
5486
  }
5585
- return assertResponse(await this.queueContext.setAccessPolicy({
5586
- abortSignal: options.abortSignal,
5587
- queueAcl: acl,
5588
- tracingOptions: updatedOptions.tracingOptions,
5589
- }));
5590
- }
5591
- catch (e) {
5592
- span.setStatus({
5593
- code: coreTracing.SpanStatusCode.ERROR,
5594
- message: e.message,
5595
- });
5596
- throw e;
5597
- }
5598
- finally {
5599
- span.end();
5600
- }
5487
+ return assertResponse(await this.queueContext.setAccessPolicy(Object.assign(Object.assign({}, updatedOptions), { queueAcl: acl })));
5488
+ });
5601
5489
  }
5602
5490
  /**
5603
5491
  * Clear deletes all messages from a queue.
@@ -5607,23 +5495,9 @@ class QueueClient extends StorageClient {
5607
5495
  * @returns Response data for the clear messages operation.
5608
5496
  */
5609
5497
  async clearMessages(options = {}) {
5610
- const { span, updatedOptions } = createSpan("QueueClient-clearMessages", options);
5611
- try {
5612
- return assertResponse(await this.messagesContext.clear({
5613
- abortSignal: options.abortSignal,
5614
- tracingOptions: updatedOptions.tracingOptions,
5615
- }));
5616
- }
5617
- catch (e) {
5618
- span.setStatus({
5619
- code: coreTracing.SpanStatusCode.ERROR,
5620
- message: e.message,
5621
- });
5622
- throw e;
5623
- }
5624
- finally {
5625
- span.end();
5626
- }
5498
+ return tracingClient.withSpan("QueueClient-clearMessages", options, async (updatedOptions) => {
5499
+ return assertResponse(await this.messagesContext.clear(updatedOptions));
5500
+ });
5627
5501
  }
5628
5502
  /**
5629
5503
  * sendMessage adds a new message to the back of a queue. The visibility timeout specifies how long
@@ -5647,8 +5521,7 @@ class QueueClient extends StorageClient {
5647
5521
  * ```
5648
5522
  */
5649
5523
  async sendMessage(messageText, options = {}) {
5650
- const { span, updatedOptions } = createSpan("QueueClient-sendMessage", options);
5651
- try {
5524
+ return tracingClient.withSpan("QueueClient-sendMessage", options, async (updatedOptions) => {
5652
5525
  const response = assertResponse(await this.messagesContext.enqueue({
5653
5526
  messageText: messageText,
5654
5527
  }, updatedOptions));
@@ -5666,17 +5539,7 @@ class QueueClient extends StorageClient {
5666
5539
  insertedOn: item.insertedOn,
5667
5540
  expiresOn: item.expiresOn,
5668
5541
  };
5669
- }
5670
- catch (e) {
5671
- span.setStatus({
5672
- code: coreTracing.SpanStatusCode.ERROR,
5673
- message: e.message,
5674
- });
5675
- throw e;
5676
- }
5677
- finally {
5678
- span.end();
5679
- }
5542
+ });
5680
5543
  }
5681
5544
  /**
5682
5545
  * receiveMessages retrieves one or more messages from the front of the queue.
@@ -5704,8 +5567,7 @@ class QueueClient extends StorageClient {
5704
5567
  * ```
5705
5568
  */
5706
5569
  async receiveMessages(options = {}) {
5707
- const { span, updatedOptions } = createSpan("QueueClient-receiveMessages", options);
5708
- try {
5570
+ return tracingClient.withSpan("QueueClient-receiveMessages", options, async (updatedOptions) => {
5709
5571
  const response = assertResponse(await this.messagesContext.dequeue(updatedOptions));
5710
5572
  const res = {
5711
5573
  _response: response._response,
@@ -5720,17 +5582,7 @@ class QueueClient extends StorageClient {
5720
5582
  res.receivedMessageItems.push(item);
5721
5583
  }
5722
5584
  return res;
5723
- }
5724
- catch (e) {
5725
- span.setStatus({
5726
- code: coreTracing.SpanStatusCode.ERROR,
5727
- message: e.message,
5728
- });
5729
- throw e;
5730
- }
5731
- finally {
5732
- span.end();
5733
- }
5585
+ });
5734
5586
  }
5735
5587
  /**
5736
5588
  * peekMessages retrieves one or more messages from the front of the queue but does not alter the visibility of the message.
@@ -5747,8 +5599,7 @@ class QueueClient extends StorageClient {
5747
5599
  * ```
5748
5600
  */
5749
5601
  async peekMessages(options = {}) {
5750
- const { span, updatedOptions } = createSpan("QueueClient-peekMessages", options);
5751
- try {
5602
+ return tracingClient.withSpan("QueueClient-peekMessages", options, async (updatedOptions) => {
5752
5603
  const response = assertResponse(await this.messagesContext.peek(updatedOptions));
5753
5604
  const res = {
5754
5605
  _response: response._response,
@@ -5763,17 +5614,7 @@ class QueueClient extends StorageClient {
5763
5614
  res.peekedMessageItems.push(item);
5764
5615
  }
5765
5616
  return res;
5766
- }
5767
- catch (e) {
5768
- span.setStatus({
5769
- code: coreTracing.SpanStatusCode.ERROR,
5770
- message: e.message,
5771
- });
5772
- throw e;
5773
- }
5774
- finally {
5775
- span.end();
5776
- }
5617
+ });
5777
5618
  }
5778
5619
  /**
5779
5620
  * deleteMessage permanently removes the specified message from its queue.
@@ -5785,23 +5626,9 @@ class QueueClient extends StorageClient {
5785
5626
  * @returns Response data for the delete message operation.
5786
5627
  */
5787
5628
  async deleteMessage(messageId, popReceipt, options = {}) {
5788
- const { span, updatedOptions } = createSpan("QueueClient-deleteMessage", options);
5789
- try {
5790
- return assertResponse(await this.getMessageIdContext(messageId).delete(popReceipt, {
5791
- abortSignal: options.abortSignal,
5792
- tracingOptions: updatedOptions.tracingOptions,
5793
- }));
5794
- }
5795
- catch (e) {
5796
- span.setStatus({
5797
- code: coreTracing.SpanStatusCode.ERROR,
5798
- message: e.message,
5799
- });
5800
- throw e;
5801
- }
5802
- finally {
5803
- span.end();
5804
- }
5629
+ return tracingClient.withSpan("QueueClient-deleteMessage", options, async (updatedOptions) => {
5630
+ return assertResponse(await this.getMessageIdContext(messageId).delete(popReceipt, updatedOptions));
5631
+ });
5805
5632
  }
5806
5633
  /**
5807
5634
  * Update changes a message's visibility timeout and contents.
@@ -5821,28 +5648,17 @@ class QueueClient extends StorageClient {
5821
5648
  * @returns Response data for the update message operation.
5822
5649
  */
5823
5650
  async updateMessage(messageId, popReceipt, message, visibilityTimeout, options = {}) {
5824
- const { span, updatedOptions } = createSpan("QueueClient-updateMessage", options);
5825
- let queueMessage = undefined;
5826
- if (message !== undefined) {
5827
- queueMessage = { messageText: message };
5828
- }
5829
- try {
5651
+ return tracingClient.withSpan("QueueClient-updateMessage", options, async (updatedOptions) => {
5652
+ let queueMessage = undefined;
5653
+ if (message !== undefined) {
5654
+ queueMessage = { messageText: message };
5655
+ }
5830
5656
  return assertResponse(await this.getMessageIdContext(messageId).update(popReceipt, visibilityTimeout || 0, {
5831
5657
  abortSignal: options.abortSignal,
5832
5658
  tracingOptions: updatedOptions.tracingOptions,
5833
5659
  queueMessage,
5834
5660
  }));
5835
- }
5836
- catch (e) {
5837
- span.setStatus({
5838
- code: coreTracing.SpanStatusCode.ERROR,
5839
- message: e.message,
5840
- });
5841
- throw e;
5842
- }
5843
- finally {
5844
- span.end();
5845
- }
5661
+ });
5846
5662
  }
5847
5663
  getQueueNameFromUrl() {
5848
5664
  let queueName;
@@ -5994,30 +5810,12 @@ class QueueServiceClient extends StorageClient {
5994
5810
  * @returns Response data for the list queues segment operation.
5995
5811
  */
5996
5812
  async listQueuesSegment(marker, options = {}) {
5997
- const { span, updatedOptions } = createSpan("QueueServiceClient-listQueuesSegment", options);
5998
5813
  if (options.prefix === "") {
5999
5814
  options.prefix = undefined;
6000
5815
  }
6001
- try {
6002
- return assertResponse(await this.serviceContext.listQueuesSegment({
6003
- abortSignal: options.abortSignal,
6004
- marker: marker,
6005
- maxPageSize: options.maxPageSize,
6006
- prefix: options.prefix,
6007
- include: options.include === undefined ? undefined : [options.include],
6008
- tracingOptions: updatedOptions.tracingOptions,
6009
- }));
6010
- }
6011
- catch (e) {
6012
- span.setStatus({
6013
- code: coreTracing.SpanStatusCode.ERROR,
6014
- message: e.message,
6015
- });
6016
- throw e;
6017
- }
6018
- finally {
6019
- span.end();
6020
- }
5816
+ return tracingClient.withSpan("QueueServiceClient-listQueuesSegment", options, async (updatedOptions) => {
5817
+ return assertResponse(await this.serviceContext.listQueuesSegment(Object.assign(Object.assign({}, updatedOptions), { marker, include: options.include === undefined ? undefined : [options.include] })));
5818
+ });
6021
5819
  }
6022
5820
  /**
6023
5821
  * Returns an AsyncIterableIterator for {@link ServiceListQueuesSegmentResponse} objects
@@ -6194,23 +5992,9 @@ class QueueServiceClient extends StorageClient {
6194
5992
  * @returns Response data including the queue service properties.
6195
5993
  */
6196
5994
  async getProperties(options = {}) {
6197
- const { span, updatedOptions } = createSpan("QueueServiceClient-getProperties", options);
6198
- try {
6199
- return assertResponse(await this.serviceContext.getProperties({
6200
- abortSignal: options.abortSignal,
6201
- tracingOptions: updatedOptions.tracingOptions,
6202
- }));
6203
- }
6204
- catch (e) {
6205
- span.setStatus({
6206
- code: coreTracing.SpanStatusCode.ERROR,
6207
- message: e.message,
6208
- });
6209
- throw e;
6210
- }
6211
- finally {
6212
- span.end();
6213
- }
5995
+ return tracingClient.withSpan("QueueServiceClient-getProperties", options, async (updatedOptions) => {
5996
+ return assertResponse(await this.serviceContext.getProperties(updatedOptions));
5997
+ });
6214
5998
  }
6215
5999
  /**
6216
6000
  * Sets properties for a storage account’s Queue service endpoint, including properties
@@ -6222,23 +6006,9 @@ class QueueServiceClient extends StorageClient {
6222
6006
  * @returns Response data for the Set Properties operation.
6223
6007
  */
6224
6008
  async setProperties(properties, options = {}) {
6225
- const { span, updatedOptions } = createSpan("QueueServiceClient-setProperties", options);
6226
- try {
6227
- return assertResponse(await this.serviceContext.setProperties(properties, {
6228
- abortSignal: options.abortSignal,
6229
- tracingOptions: updatedOptions.tracingOptions,
6230
- }));
6231
- }
6232
- catch (e) {
6233
- span.setStatus({
6234
- code: coreTracing.SpanStatusCode.ERROR,
6235
- message: e.message,
6236
- });
6237
- throw e;
6238
- }
6239
- finally {
6240
- span.end();
6241
- }
6009
+ return tracingClient.withSpan("QueueServiceClient-setProperties", options, async (updatedOptions) => {
6010
+ return assertResponse(await this.serviceContext.setProperties(properties, updatedOptions));
6011
+ });
6242
6012
  }
6243
6013
  /**
6244
6014
  * Retrieves statistics related to replication for the Queue service. It is only
@@ -6250,23 +6020,9 @@ class QueueServiceClient extends StorageClient {
6250
6020
  * @returns Response data for get statistics the operation.
6251
6021
  */
6252
6022
  async getStatistics(options = {}) {
6253
- const { span, updatedOptions } = createSpan("QueueServiceClient-getStatistics", options);
6254
- try {
6255
- return assertResponse(await this.serviceContext.getStatistics({
6256
- abortSignal: options.abortSignal,
6257
- tracingOptions: updatedOptions.tracingOptions,
6258
- }));
6259
- }
6260
- catch (e) {
6261
- span.setStatus({
6262
- code: coreTracing.SpanStatusCode.ERROR,
6263
- message: e.message,
6264
- });
6265
- throw e;
6266
- }
6267
- finally {
6268
- span.end();
6269
- }
6023
+ return tracingClient.withSpan("QueueServiceClient-getStatistics", options, async (updatedOptions) => {
6024
+ return assertResponse(await this.serviceContext.getStatistics(updatedOptions));
6025
+ });
6270
6026
  }
6271
6027
  /**
6272
6028
  * Creates a new queue under the specified account.
@@ -6277,20 +6033,9 @@ class QueueServiceClient extends StorageClient {
6277
6033
  * @returns Response data for the Queue create operation.
6278
6034
  */
6279
6035
  async createQueue(queueName, options = {}) {
6280
- const { span, updatedOptions } = createSpan("QueueServiceClient-createQueue", options);
6281
- try {
6282
- return await this.getQueueClient(queueName).create(updatedOptions);
6283
- }
6284
- catch (e) {
6285
- span.setStatus({
6286
- code: coreTracing.SpanStatusCode.ERROR,
6287
- message: e.message,
6288
- });
6289
- throw e;
6290
- }
6291
- finally {
6292
- span.end();
6293
- }
6036
+ return tracingClient.withSpan("QueueServiceClient-createQueue", options, async (updatedOptions) => {
6037
+ return this.getQueueClient(queueName).create(updatedOptions);
6038
+ });
6294
6039
  }
6295
6040
  /**
6296
6041
  * Deletes the specified queue permanently.
@@ -6301,20 +6046,9 @@ class QueueServiceClient extends StorageClient {
6301
6046
  * @returns Response data for the Queue delete operation.
6302
6047
  */
6303
6048
  async deleteQueue(queueName, options = {}) {
6304
- const { span, updatedOptions } = createSpan("QueueServiceClient-deleteQueue", options);
6305
- try {
6306
- return await this.getQueueClient(queueName).delete(updatedOptions);
6307
- }
6308
- catch (e) {
6309
- span.setStatus({
6310
- code: coreTracing.SpanStatusCode.ERROR,
6311
- message: e.message,
6312
- });
6313
- throw e;
6314
- }
6315
- finally {
6316
- span.end();
6317
- }
6049
+ return tracingClient.withSpan("QueueServiceClient-deleteQueue", options, async (updatedOptions) => {
6050
+ return this.getQueueClient(queueName).delete(updatedOptions);
6051
+ });
6318
6052
  }
6319
6053
  /**
6320
6054
  * Only available for QueueServiceClient constructed with a shared key credential.