All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.connect.amazon.sqs.sqsExtensions.kt Maven / Gradle / Ivy

package org.http4k.connect.amazon.sqs

import dev.forkhandles.result4k.Result
import java.time.ZonedDateTime
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Unit
import kotlin.collections.Collection
import kotlin.collections.List
import kotlin.collections.Map
import org.http4k.connect.RemoteFailure
import org.http4k.connect.amazon.core.model.MessageFieldsDto
import org.http4k.connect.amazon.core.model.Tag
import org.http4k.connect.amazon.sqs.action.CreateQueue
import org.http4k.connect.amazon.sqs.action.CreatedQueue
import org.http4k.connect.amazon.sqs.action.DeleteMessage
import org.http4k.connect.amazon.sqs.action.DeleteMessageBatch
import org.http4k.connect.amazon.sqs.action.DeleteMessageBatchEntry
import org.http4k.connect.amazon.sqs.action.DeleteQueue
import org.http4k.connect.amazon.sqs.action.GetQueueAttributes
import org.http4k.connect.amazon.sqs.action.ListQueues
import org.http4k.connect.amazon.sqs.action.QueueAttributes
import org.http4k.connect.amazon.sqs.action.ReceiveMessage
import org.http4k.connect.amazon.sqs.action.SendMessage
import org.http4k.connect.amazon.sqs.action.SendMessageBatch
import org.http4k.connect.amazon.sqs.action.SendMessageBatchEntry
import org.http4k.connect.amazon.sqs.action.SendMessageBatchResultEntry
import org.http4k.connect.amazon.sqs.action.SentMessage
import org.http4k.connect.amazon.sqs.model.MessageAttribute
import org.http4k.connect.amazon.sqs.model.MessageSystemAttribute
import org.http4k.connect.amazon.sqs.model.QueueName
import org.http4k.connect.amazon.sqs.model.ReceiptHandle
import org.http4k.connect.amazon.sqs.model.SQSMessage
import org.http4k.connect.amazon.sqs.model.SQSMessageId
import org.http4k.core.Uri

/**
 * @see org.http4k.connect.amazon.sqs.action.CreateQueue
 */
public fun SQS.createQueue(
  QueueName: QueueName,
  Tags: Map? = null,
  Attributes: Map? = null,
): Result = invoke(CreateQueue(QueueName, Tags, Attributes))

/**
 * @see org.http4k.connect.amazon.sqs.action.CreateQueue
 */
public fun SQS.createQueue(
  queueName: QueueName,
  tags: List? = null,
  attributes: Map? = null,
  expires: ZonedDateTime? = null,
): Result = invoke(CreateQueue(queueName, tags, attributes, expires))

/**
 * @see org.http4k.connect.amazon.sqs.action.DeleteMessage
 */
public fun SQS.deleteMessage(
  queueUrl: Uri,
  receiptHandle: ReceiptHandle,
  expires: ZonedDateTime? = null,
): Result = invoke(DeleteMessage(queueUrl, receiptHandle, expires))

/**
 * @see org.http4k.connect.amazon.sqs.action.DeleteMessageBatch
 */
public fun SQS.deleteMessageBatch(queueUrl: Uri, entries: List): Result, RemoteFailure> = invoke(DeleteMessageBatch(queueUrl, entries))

/**
 * @see org.http4k.connect.amazon.sqs.action.DeleteMessageBatch
 */
public fun SQS.deleteMessageBatch(queueUrl: Uri, entries: Collection>): Result, RemoteFailure> = invoke(DeleteMessageBatch(queueUrl, entries))

/**
 * @see org.http4k.connect.amazon.sqs.action.DeleteQueue
 */
public fun SQS.deleteQueue(QueueUrl: Uri, expires: ZonedDateTime? = null): Result = invoke(DeleteQueue(QueueUrl, expires))

/**
 * @see org.http4k.connect.amazon.sqs.action.GetQueueAttributes
 */
public fun SQS.getQueueAttributes(queueUrl: Uri, attributes: List? = null): Result = invoke(GetQueueAttributes(queueUrl, attributes))

/**
 * @see org.http4k.connect.amazon.sqs.action.ListQueues
 */
public fun SQS.listQueues(
  MaxResults: Int? = null,
  NextToken: String? = null,
  QueueNamePrefix: String? = null,
): Result, RemoteFailure> = invoke(ListQueues(MaxResults, NextToken, QueueNamePrefix))

/**
 * @see org.http4k.connect.amazon.sqs.action.ReceiveMessage
 */
public fun SQS.receiveMessage(
  queueUrl: Uri,
  maxNumberOfMessages: Int? = null,
  visibilityTimeout: Int? = null,
  expires: ZonedDateTime? = null,
  waitTimeSeconds: Int? = null,
  messageAttributes: List? = null,
  receiveRequestAttemptId: String? = null,
  attributeNames: List? = null,
): Result, RemoteFailure> = invoke(ReceiveMessage(queueUrl, maxNumberOfMessages, visibilityTimeout, expires, waitTimeSeconds, messageAttributes, receiveRequestAttemptId, attributeNames))

/**
 * @see org.http4k.connect.amazon.sqs.action.SendMessage
 */
public fun SQS.sendMessage(
  queueUrl: Uri,
  messageBody: String,
  delaySeconds: Int? = null,
  messageDeduplicationId: String? = null,
  messageGroupId: String? = null,
  messageAttributes: Map? = null,
  messageSystemAttributes: Map? = null,
): Result = invoke(SendMessage(queueUrl, messageBody, delaySeconds, messageDeduplicationId, messageGroupId, messageAttributes, messageSystemAttributes))

/**
 * @see org.http4k.connect.amazon.sqs.action.SendMessage
 */
public fun SQS.sendMessage(
  queueUrl: Uri,
  payload: String,
  delaySeconds: Int? = null,
  deduplicationId: String? = null,
  messageGroupId: String? = null,
  expires: ZonedDateTime? = null,
  attributes: List? = null,
  systemAttributes: List? = null,
): Result = invoke(SendMessage(queueUrl, payload, delaySeconds, deduplicationId, messageGroupId, expires, attributes, systemAttributes))

/**
 * @see org.http4k.connect.amazon.sqs.action.SendMessageBatch
 */
public fun SQS.sendMessageBatch(queueUrl: Uri, entries: List): Result, RemoteFailure> = invoke(SendMessageBatch(queueUrl, entries))




© 2015 - 2025 Weber Informatics LLC | Privacy Policy