# LocalStack Resource Provider Base Class Scaffolding {{ scaffolding_version }}
#
# AUTOGENERATED FILE - DO NOT EDIT
#

from __future__ import annotations

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

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

{{ provider_properties }}

REPEATED_INVOCATION = "repeated_invocation"

class {{ resource }}ProviderBase(ResourceProvider[{{ resource }}Properties], ABC):

    TYPE = "{{ name }}"  # Autogenerated. Don't change
    SCHEMA = util.get_schema_path(Path(__file__))  # Autogenerated. Don't change

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

        {% if primary_identifier -%}
        Primary identifier fields:
        {%- for property in primary_identifier %}
          - {{ property }}
        {%- endfor %}
        {%- endif %}

        {% if required_properties -%}
        Required properties:
        {%- for property in required_properties %}
          - {{ property }}
        {%- endfor %}
        {%- endif %}

        {% if create_only_properties -%}
        Create-only properties:
        {%- for property in create_only_properties %}
          - {{ property }}
        {%- endfor %}
        {%- endif %}

        {% if read_only_properties -%}
        Read-only properties:
        {%- for property in read_only_properties %}
          - {{ property }}
        {%- endfor %}
        {%- endif %}

        {% if create_permissions -%}
        IAM permissions required:
        {%- for permission in create_permissions %}
          - {{ permission }}
        {%- endfor -%}
        {%- endif %}

        """
        raise NotImplementedError

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

        {% if read_permissions -%}
        IAM permissions required:
        {%- for permission in read_permissions %}
          - {{ permission }}
        {%- endfor %}
        {%- endif %}
        """
        raise NotImplementedError

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

        {% if delete_permissions -%}
        IAM permissions required:
        {%- for permission in delete_permissions %}
          - {{ permission }}
        {%- endfor %}
        {%- endif %}
        """
        raise NotImplementedError

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

        {% if update_permissions -%}
        IAM permissions required:
        {%- for permission in update_permissions %}
          - {{ permission }}
        {%- endfor %}
        {%- endif %}
        """
        raise NotImplementedError

    @abstractmethod
    def list(
        self,
        request: ResourceRequest[{{ resource }}Properties],
    ) -> ProgressEvent[{{ resource }}Properties]:
        """
        List available resources of this type
        {% if list_permissions -%}
        IAM permissions required:
        {%- for permission in list_permissions %}
          - {{ permission }}
        {%- endfor %}
        {%- endif %}
        """
        raise NotImplementedError
