# LocalStack Resource Provider Base Class Scaffolding v2
#
# AUTOGENERATED FILE - DO NOT EDIT
#

from __future__ import annotations

from abc import ABC, abstractmethod
from pathlib import Path
from typing import TypedDict

import localstack.services.cloudformation.provider_utils as util
from localstack.services.cloudformation.resource_provider import (
    ProgressEvent,
    ResourceProvider,
    ResourceRequest,
)


class SQSQueueProperties(TypedDict):
    Arn: str | None
    ContentBasedDeduplication: bool | None
    DeduplicationScope: str | None
    DelaySeconds: int | None
    FifoQueue: bool | None
    FifoThroughputLimit: str | None
    KmsDataKeyReusePeriodSeconds: int | None
    KmsMasterKeyId: str | None
    MaximumMessageSize: int | None
    MessageRetentionPeriod: int | None
    QueueName: str | None
    QueueUrl: str | None
    ReceiveMessageWaitTimeSeconds: int | None
    RedriveAllowPolicy: dict | str | None
    RedrivePolicy: dict | str | None
    SqsManagedSseEnabled: bool | None
    Tags: list[Tag] | None
    VisibilityTimeout: int | None


class Tag(TypedDict):
    Key: str | None
    Value: str | None


REPEATED_INVOCATION = "repeated_invocation"


class SQSQueueProviderBase(ResourceProvider[SQSQueueProperties], ABC):
    TYPE = "AWS::SQS::Queue"  # Autogenerated. Don't change
    SCHEMA = util.get_schema_path(Path(__file__))  # Autogenerated. Don't change

    @abstractmethod
    def create(
        self,
        request: ResourceRequest[SQSQueueProperties],
    ) -> ProgressEvent[SQSQueueProperties]:
        """
        Create a new resource.

        Primary identifier fields:
          - /properties/QueueUrl



        Create-only properties:
          - /properties/FifoQueue
          - /properties/QueueName

        Read-only properties:
          - /properties/QueueUrl
          - /properties/Arn

        IAM permissions required:
          - sqs:CreateQueue
          - sqs:GetQueueUrl
          - sqs:GetQueueAttributes
          - sqs:ListQueueTags
          - sqs:TagQueue

        """
        raise NotImplementedError

    @abstractmethod
    def read(
        self,
        request: ResourceRequest[SQSQueueProperties],
    ) -> ProgressEvent[SQSQueueProperties]:
        """
        Fetch resource information

        IAM permissions required:
          - sqs:GetQueueAttributes
          - sqs:ListQueueTags
        """
        raise NotImplementedError

    @abstractmethod
    def delete(
        self,
        request: ResourceRequest[SQSQueueProperties],
    ) -> ProgressEvent[SQSQueueProperties]:
        """
        Delete a resource

        IAM permissions required:
          - sqs:DeleteQueue
          - sqs:GetQueueAttributes
        """
        raise NotImplementedError

    @abstractmethod
    def update(
        self,
        request: ResourceRequest[SQSQueueProperties],
    ) -> ProgressEvent[SQSQueueProperties]:
        """
        Update a resource

        IAM permissions required:
          - sqs:SetQueueAttributes
          - sqs:GetQueueAttributes
          - sqs:ListQueueTags
          - sqs:TagQueue
          - sqs:UntagQueue
        """
        raise NotImplementedError

    @abstractmethod
    def list(
        self,
        request: ResourceRequest[SQSQueueProperties],
    ) -> ProgressEvent[SQSQueueProperties]:
        """
        List available resources of this type
        IAM permissions required:
          - sqs:ListQueues
        """
        raise NotImplementedError
