o
    tBh.*                     @   s@   d dl mZmZ d dlmZmZmZmZmZ G dd deZ	dS )    )sp_endpointfill_query_params)ClientMarketplaces
deprecatedNotificationTypeApiResponsec                   @   s  e Zd ZdZdZedepefddZe	dddd%deped
ede
fddZe	ddep.ede
fddZe	ddddep?edede
fddZe	dddd&dedededede
f
ddZe	dddde
fddZe	d ddd
ede
fd!d"Ze	d ddd
ede
fd#d$Zd	S )'Notificationszy
    :link: https://github.com/amzn/selling-partner-api-docs/blob/main/references/notifications-api/notifications.md
    z sellingpartnerapi::notificationsnotification_typec                 K   s   | j |fi |S )z#deprecated, use create_subscription)create_subscriptionselfr
   kwargs r   }/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/sp_api/api/notifications/notifications.pyadd_subscription   s   zNotifications.add_subscriptionz"/notifications/v1/subscriptions/{}POST)methodNdestination_idreturnc                 K   sL   | d|| ddd}| jt| dt|tr|n|ji ||dS )an  
        create_subscription(self, notification_type: NotificationType or str, destination_id: str = None, **kwargs) -> ApiResponse
        Creates a subscription for the specified notification type to be delivered to the specified destination.
        Before you can subscribe, you must first create the destination by calling the createDestination operation.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============

        For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

        Examples:
            literal blocks::

                Notifications().create_subscription(NotificationType.MFN_ORDER_STATUS_CHANGE, destination_id='dest_id')

        Args:
            notification_type: NotificationType or str
            destination_id: str
            **kwargs:


        Returns:
            ApiResponse:

        destinationIdpayload_versionz1.0)r   payloadVersionpathdata)pop_requestr   
isinstancestrvalue)r   r
   r   r   r   r   r   r   r      s   
"

z!Notifications.create_subscriptionc                 K   s.   | j t|dt|tr|n|ji |dS )a  
        get_subscription(self, notification_type: NotificationType or str, **kwargs) -> ApiResponse
        Returns information about subscriptions of the specified notification type. You can use this API to get subscription information when you do not have a subscription identifier.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============

        For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

        Examples:
            literal blocks::

                Notifications().get_subscription(NotificationType.REPORT_PROCESSING_FINISHED)

        Args:
            notification_type: NotificationType or str
            **kwargs:

        Returns:
            ApiResponse:

        r   paramsr   r   r   r   r   r    r   r   r   r   get_subscription:   s   zNotifications.get_subscriptionz%/notifications/v1/subscriptions/{}/{}DELETEsubscription_idc                 K   s0   | j t|dt|tr|n|j|i |dS )aB  
        delete_notification_subscription(self, notification_type: NotificationType or str, subscription_id: str, **kwargs) -> ApiResponse
        Deletes the subscription indicated by the subscription identifier and notification type that you specify.
        The subscription identifier can be for any subscription associated with your application. After you successfully call this operation, notifications will stop being sent for the associated subscription. The deleteSubscriptionById API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============

        For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

        Examples:
            Notifications().delete_notification_subscription(NotificationType.MFN_ORDER_STATUS_CHANGE, 'subscription_id')

        Args:
            notification_type: NotificationType or str
            subscription_id: str
            **kwargs:

        Returns:
            ApiResponse:

        r   r!   r#   )r   r
   r&   r   r   r   r    delete_notification_subscription[   s   
z.Notifications.delete_notification_subscriptionz/notifications/v1/destinations)r   r   namearn
account_idregionc                 K   sV   |sdnd}|r
|n| j }||sd|in||di|d}| j|di ||dS )a  
        create_destination(self, name: str, arn: str, **kwargs) -> ApiResponse
        Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============

        Examples:
            literal blocks::

                Notifications().create_destination(name='test', arn='arn:aws:sqs:us-east-2:444455556666:queue1')

        Args:
            account_id:
            region:
            name: str
            arn: str
            **kwargs:

        Returns:
            ApiResponse:

        sqseventBridger)   )r+   	accountId)resourceSpecificationr(   r   r   )r+   _request_grantless_operationr   )r   r(   r)   r*   r+   r   resource_namer   r   r   r   create_destination   s   z Notifications.create_destinationGETc                 K   s   | j |di |dS )a  
        get_destinations(self, **kwargs) -> ApiResponse
        Returns information about all destinations. The getDestinations API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============


        For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

        Args:
            **kwargs:

        Returns:
            ApiResponse:

        r   r!   )r0   r   )r   r   r   r   r   get_destinations   s   zNotifications.get_destinationsz!/notifications/v1/destinations/{}c                 K      | j t|d|i |dS )a*  
        get_destination(self, destination_id: str, **kwargs) -> ApiResponse
        Returns information about all destinations. The getDestinations API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============

        For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.


        Args:
            destination_id: str
            **kwargs:

        Returns:
            ApiResponse:


        r   r!   r0   r   r   r   r   r   r   r   r   get_destination   s   zNotifications.get_destinationc                 K   r5   )a+  
        delete_destination(self, destination_id: str, **kwargs) -> ApiResponse
        Deletes the destination that you specify. The deleteDestination API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.

        **Usage Plan:**

        ======================================  ==============
        Rate (requests per second)               Burst
        ======================================  ==============
        1                                       5
        ======================================  ==============

        For more information, see "Usage Plans and Rate Limits" in the Selling Partner API documentation.

        Args:
            destination_id: str
            **kwargs:

        Returns:
            ApiResponse:

        r   r!   r6   r7   r   r   r   delete_destination   s   z Notifications.delete_destination)N)NNN)__name__
__module____qualname____doc__grantless_scoper   r   r   r   r   r   r   r$   r'   r2   r4   r8   r9   r   r   r   r   r	      s.    
)
 
#"
.

r	   N)
sp_api.base.helpersr   r   sp_api.baser   r   r   r   r   r	   r   r   r   r   <module>   s    