
    h                     2    d dl mZ ddlmZ  G d de      Zy)   )Resource   )URLc                   V     e Zd Zd fd	Zi fdZi f fd	Zi f fd	Zi fdZd Z xZ	S )Itemc                 x    t         t        |   |       t        j                  t        j
                  z   | _        y N)superr   __init__r   V1ITEM_URLbase_url)selfclient	__class__s     U/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/razorpay/resources/item.pyr   zItem.__init__   s&    dD"6*-    c                 B    | j                   } | j                  ||fi |S )zW
        Create item

        Returns:
            Item Dict which was created
        )r   post_url)r   datakwargsurls       r   createzItem.create
   s%     mmt}}S$1&11r   c                 .    t        t        | 
  ||fi |S )z
        Fetch an Item

        Args:
            item_id : The id of the item to be fetched

        Returns:
            Item dict for given card Id
        )r
   r   fetch)r   item_idr   r   r   s       r   r   z
Item.fetch   s     T4&w???r   c                 ,    t        t        | 
  |fi |S )zX
        Fetch all items

        Returns:
            Dictionary of Items data
        )r
   r   all)r   r   r   r   s      r   r   zItem.all    s     T4$T4V44r   c                 b    dj                  | j                  |      } | j                  ||fi |S )zY
        Update an Item

        Returns:
            Item Dict which was edited
        {}/{})formatr   	patch_url)r   r   r   r   r   s        r   editz	Item.edit)   s0     nnT]]G4t~~c42622r   c                 b    dj                  | j                  |      } | j                  |i fi |S )z
        Delete an Item

        Args:
            item_id : The id of the item to be deleted

        Returns:
            The response is always be an empty array like this - []
        r    )r!   r   
delete_url)r   r   r   r   s       r   deletezItem.delete4   s0     nnT]]G4tsB1&11r   r	   )
__name__
__module____qualname__r   r   r   r   r#   r&   __classcell__)r   s   @r   r   r      s6    .  2 #% 
@  5 "$ 	32r   r   N)baser   constants.urlr   r    r   r   <module>r.      s     :28 :2r   