getQueueUrl method

Future<GetQueueUrlResult> getQueueUrl({
  1. required String queueName,
  2. String? queueOwnerAWSAccountId,
})

Returns the URL of an existing Amazon SQS queue.

To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId parameter to specify the account ID of the queue's owner. The queue's owner must grant you permission to access the queue. For more information about shared queue access, see AddPermission or see Allow Developers to Write Messages to a Shared Queue in the Amazon Simple Queue Service Developer Guide.

May throw QueueDoesNotExist.

Parameter queueName : The name of the queue whose URL must be fetched. Maximum 80 characters. Valid values: alphanumeric characters, hyphens (-), and underscores (_).

Queue URLs and names are case-sensitive.

Parameter queueOwnerAWSAccountId : The AWS account ID of the account that created the queue.

Implementation

Future<GetQueueUrlResult> getQueueUrl({
  required String queueName,
  String? queueOwnerAWSAccountId,
}) async {
  ArgumentError.checkNotNull(queueName, 'queueName');
  final $request = <String, dynamic>{};
  $request['QueueName'] = queueName;
  queueOwnerAWSAccountId
      ?.also((arg) => $request['QueueOwnerAWSAccountId'] = arg);
  final $result = await _protocol.send(
    $request,
    action: 'GetQueueUrl',
    version: '2012-11-05',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['GetQueueUrlRequest'],
    shapes: shapes,
    resultWrapper: 'GetQueueUrlResult',
  );
  return GetQueueUrlResult.fromXml($result);
}