@@ -449,75 +449,41 @@ namespace NKikimr::NYmq::V1 {
449
449
450
450
Ydb::Ymq::V1::GetQueueAttributesResult GetResult (const NKikimrClient::TSqsResponse& resp) override {
451
451
Ydb::Ymq::V1::GetQueueAttributesResult result;
452
- for (const auto & attributeName : Attributes) {
453
- if (attributeName == APPROXIMATE_NUMBER_OF_MESSAGES) {
454
- AddAttribute (
455
- result,
456
- APPROXIMATE_NUMBER_OF_MESSAGES,
457
- GetResponse (resp).GetApproximateNumberOfMessages ()
458
- );
459
- } else if (attributeName == APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED) {
460
- AddAttribute (
461
- result,
462
- APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED,
463
- GetResponse (resp).GetApproximateNumberOfMessagesDelayed ()
464
- );
465
- } else if (attributeName == CREATED_TIMESTAMP) {
466
- AddAttribute (
467
- result,
468
- CREATED_TIMESTAMP,
469
- GetResponse (resp).GetCreatedTimestamp ()
470
- );
471
- } else if (attributeName == DELAY_SECONDS) {
472
- AddAttribute (
473
- result,
474
- DELAY_SECONDS,
475
- GetResponse (resp).GetDelaySeconds ()
476
- );
477
- } else if (attributeName == LAST_MODIFIED_TIMESTAMP) {
478
- AddAttribute (
479
- result,
480
- LAST_MODIFIED_TIMESTAMP,
481
- GetResponse (resp).GetLastModifiedTimestamp ()
482
- );
483
- } else if (attributeName == MAXIMUM_MESSAGE_SIZE) {
484
- AddAttribute (
485
- result,
486
- MAXIMUM_MESSAGE_SIZE,
487
- GetResponse (resp).GetMaximumMessageSize ()
488
- );
489
- } else if (attributeName == MESSAGE_RETENTION_PERIOD) {
490
- AddAttribute (
491
- result,
492
- MESSAGE_RETENTION_PERIOD,
493
- GetResponse (resp).GetMessageRetentionPeriod ()
494
- );
495
- } else if (attributeName == QUEUE_ARN) {
496
- AddAttribute (
497
- result,
498
- QUEUE_ARN,
499
- GetResponse (resp).GetQueueArn ()
500
- );
501
- } else if (attributeName == RECEIVE_MESSAGE_WAIT_TIME_SECONDS) {
502
- AddAttribute (
503
- result,
504
- RECEIVE_MESSAGE_WAIT_TIME_SECONDS,
505
- GetResponse (resp).GetReceiveMessageWaitTimeSeconds ()
506
- );
507
- } else if (attributeName == VISIBILITY_TIMEOUT) {
508
- AddAttribute (
509
- result,
510
- VISIBILITY_TIMEOUT,
511
- GetResponse (resp).GetVisibilityTimeout ()
512
- );
513
- } else if (attributeName == REDRIVE_POLICY) {
514
- AddAttribute (
515
- result,
516
- REDRIVE_POLICY,
517
- GetResponse (resp).GetRedrivePolicy ()
518
- );
519
- }
452
+ const auto & attrs = resp.GetGetQueueAttributes ();
453
+ if (attrs.HasApproximateNumberOfMessages ()) {
454
+ AddAttribute (result, APPROXIMATE_NUMBER_OF_MESSAGES, attrs.GetApproximateNumberOfMessages ());
455
+ }
456
+ if (attrs.HasApproximateNumberOfMessagesDelayed ()) {
457
+ AddAttribute (result, APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED, attrs.GetApproximateNumberOfMessagesDelayed ());
458
+ }
459
+ if (attrs.HasCreatedTimestamp ()) {
460
+ AddAttribute (result, CREATED_TIMESTAMP, attrs.GetCreatedTimestamp ());
461
+ }
462
+ if (attrs.HasDelaySeconds ()) {
463
+ AddAttribute (result, DELAY_SECONDS, attrs.GetDelaySeconds ());
464
+ }
465
+ if (attrs.HasLastModifiedTimestamp ()) {
466
+ AddAttribute (result, LAST_MODIFIED_TIMESTAMP, attrs.GetLastModifiedTimestamp ());
467
+ }
468
+ if (attrs.HasMaximumMessageSize ()) {
469
+ AddAttribute (result, MAXIMUM_MESSAGE_SIZE, attrs.GetMaximumMessageSize ());
520
470
}
471
+ if (attrs.HasMessageRetentionPeriod ()) {
472
+ AddAttribute (result, MESSAGE_RETENTION_PERIOD, attrs.GetMessageRetentionPeriod ());
473
+ }
474
+ if (attrs.HasQueueArn ()) {
475
+ AddAttribute (result, QUEUE_ARN, attrs.GetQueueArn ());
476
+ }
477
+ if (attrs.HasReceiveMessageWaitTimeSeconds ()) {
478
+ AddAttribute (result, RECEIVE_MESSAGE_WAIT_TIME_SECONDS, attrs.GetReceiveMessageWaitTimeSeconds ());
479
+ }
480
+ if (attrs.HasVisibilityTimeout ()) {
481
+ AddAttribute (result, VISIBILITY_TIMEOUT, attrs.GetVisibilityTimeout ());
482
+ }
483
+ if (attrs.HasRedrivePolicy ()) {
484
+ AddAttribute (result, REDRIVE_POLICY, attrs.GetRedrivePolicy ());
485
+ }
486
+
521
487
return result;
522
488
}
523
489
0 commit comments