
    Ch_                         S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJr  S SKJrJrJr  S S	KJrJrJr   " S
 S\5      rg)    )
CreditNote)CreditNoteLineItemService)CreditNotePreviewLinesService)
ListObject)RequestOptions)StripeService)sanitize_id)DictListcast)LiteralNotRequired	TypedDictc            	         ^  \ rS rSrU 4S jr " S S\5      r " S S\5      r " S S\5      r " S	 S
\5      r	 " S S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S \5      r0 0 4S!S"S#\S$\\   4S% jjr0 0 4S!S"S#\S$\\   4S& jjr0 4S!S'S#\S$\4S( jjr0 4S!S'S#\S$\4S) jjr0 0 4S*\S!S+S#\S$\4S, jjr0 0 4S*\S!S+S#\S$\4S- jjr0 0 4S*\S!S.S#\S$\4S/ jjr0 0 4S*\S!S.S#\S$\4S0 jjr 0 4S!S1S#\S$\4S2 jjr!0 4S!S1S#\S$\4S3 jjr"0 0 4S*\S!S4S#\S$\4S5 jjr#0 0 4S*\S!S4S#\S$\4S6 jjr$S7r%U =r&$ )8CreditNoteService   c                    > [         TU ]  U5        [        U R                  5      U l        [        U R                  5      U l        g )N)super__init__r   
_requestor
line_itemsr   preview_lines)self	requestor	__class__s     ^/home/kali/devsecops-assessor/venv/lib/python3.13/site-packages/stripe/_credit_note_service.pyr   CreditNoteService.__init__   s1    #3DOOD:4??K    c                   2   \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\S      \S'    \\\	      \S'    \	\S'    \\S	      \S
'    \\	   \S'    \\
\	\	4      \S'    \\   \S'    \\S      \S'    \\   \S'    \\S      \S'    \S   \S'   Srg)CreditNoteService.CreateParams   amountcredit_amounteffective_atcredit_notenone
email_typeexpandinvoice"CreditNoteService.CreateParamsLinelinesmemometadataout_of_band_amount	duplicate
fraudulentorder_changeproduct_unsatisfactoryreasonrefund_amount$CreditNoteService.CreateParamsRefundrefunds*CreditNoteService.CreateParamsShippingCostshipping_cost N__name__
__module____qualname____firstlineno__r   int__annotations__r   r   strr
   __static_attributes__r;   r   r   CreateParamsr       s(   C  	 #3''	 "#&&	  (= >??	 DI&&	 	 4 DEFF	 #	 d38n--	 (,,	 *
 	
	 #3''	 T"HIJJ	 #8
 	
	r   rE   c                       \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\   \S'    \S   \S'    \S   \S	'    \S
   \S'    \\   \S'    \\   \S'   Sr	g)r+   Y   r"   descriptioninvoice_line_itemquantityz=Literal['']|List[CreditNoteService.CreateParamsLineTaxAmount]tax_amountsLiteral['']|List[str]	tax_ratescustom_line_itemrI   typeunit_amountunit_amount_decimalr;   N
r=   r>   r?   r@   r   rA   rB   rC   r   rD   r;   r   r   CreateParamsLine"CreditNoteService.CreateParamsLineY   s    C  	 !%%	 's++	 c""	 !K
 	
	 677	 =>>	 !%%	 )--	r   rT   c                   8    \ rS rSr% \\S'    \\S'    \\S'   Srg)+CreditNoteService.CreateParamsLineTaxAmount   r"   tax_ratetaxable_amountr;   Nr=   r>   r?   r@   rA   rB   rC   rD   r;   r   r   CreateParamsLineTaxAmountrW      %    	 	 	r   r\   c                   8    \ rS rSr% \\   \S'    \\   \S'   Srg)r7      amount_refundedrefundr;   N	r=   r>   r?   r@   r   rA   rB   rC   rD   r;   r   r   CreateParamsRefund$CreditNoteService.CreateParamsRefund   $    $S))	 C  	r   rc   c                   &    \ rS rSr% \\   \S'   Srg)r9      shipping_rater;   Nr=   r>   r?   r@   r   rC   rB   rD   r;   r   r   CreateParamsShippingCost*CreditNoteService.CreateParamsShippingCost       "3''	r   rj   c                       \ rS rSr% \S   \S'    \\   \S'    \\   \S'    \\\      \S'    \\   \S'    \\   \S'    \\   \S	'   S
r	g)CreditNoteService.ListParams   z'CreditNoteService.ListParamsCreated|intcreatedcustomerending_beforer)   r*   limitstarting_afterr;   N)
r=   r>   r?   r@   r   rB   rC   r   rA   rD   r;   r   r   
ListParamsrn      s    FGG	 c""	 #3''	 DI&&	 S!!	 3	 $C((	r   ru   c                   \    \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\   \S'   Srg)#CreditNoteService.ListParamsCreated   gtgteltlter;   N)r=   r>   r?   r@   r   rA   rB   rD   r;   r   r   ListParamsCreatedrw      sH    	 	 	 	r   r}   c                   2   \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\S      \S'    \\\	      \S'    \	\S'    \\S	      \S
'    \\	   \S'    \\
\	\	4      \S'    \\   \S'    \\S      \S'    \\   \S'    \\S      \S'    \S   \S'   Srg)CreditNoteService.PreviewParams   r"   r#   r$   r%   r(   r)   r*   #CreditNoteService.PreviewParamsLiner,   r-   r.   r/   r0   r5   r6   %CreditNoteService.PreviewParamsRefundr8   +CreditNoteService.PreviewParamsShippingCostr:   r;   Nr<   r;   r   r   PreviewParamsr      s(   C  	 #3''	 "#&&	  (= >??	 DI&&	 	 4 EFGG	 #	 d38n--	 (,,	 *
 	
	 #3''	 T"IJKK	 #9
 	
	r   r   c                       \ rS rSr% \\   \S'    \\   \S'    \\   \S'    \\   \S'    \S   \S'    \S   \S	'    \S
   \S'    \\   \S'    \\   \S'   Sr	g)r   i  r"   rH   rI   rJ   z>Literal['']|List[CreditNoteService.PreviewParamsLineTaxAmount]rK   rL   rM   rN   rP   rQ   rR   r;   NrS   r;   r   r   PreviewParamsLine#CreditNoteService.PreviewParamsLine  s    C  	 !%%	 's++	 c""	 !L
 	
	 677	 =>>	 !%%	 )--	r   r   c                   8    \ rS rSr% \\S'    \\S'    \\S'   Srg),CreditNoteService.PreviewParamsLineTaxAmounti:  r"   rY   rZ   r;   Nr[   r;   r   r   PreviewParamsLineTaxAmountr   :  r]   r   r   c                   8    \ rS rSr% \\   \S'    \\   \S'   Srg)r   iH  r`   ra   r;   Nrb   r;   r   r   PreviewParamsRefund%CreditNoteService.PreviewParamsRefundH  re   r   r   c                   &    \ rS rSr% \\   \S'   Srg)r   iR  rh   r;   Nri   r;   r   r   PreviewParamsShippingCost+CreditNoteService.PreviewParamsShippingCostR  rl   r   r   c                   ,    \ rS rSr% \\\      \S'   Srg) CreditNoteService.RetrieveParamsiX  r)   r;   N	r=   r>   r?   r@   r   r   rC   rB   rD   r;   r   r   RetrieveParamsr   X      DI&&	r   r   c                   Z    \ rS rSr% \\\      \S'    \\   \S'    \\\\4      \S'   Sr	g)CreditNoteService.UpdateParamsi^  r)   r-   r.   r;   N)
r=   r>   r?   r@   r   r   rC   rB   r
   rD   r;   r   r   UpdateParamsr   ^  sB    DI&&	 #	 d38n--	r   r   c                   ,    \ rS rSr% \\\      \S'   Srg)&CreditNoteService.VoidCreditNoteParamsil  r)   r;   Nr   r;   r   r   VoidCreditNoteParamsr   l  r   r   r   paramsrn   optionsreturnc                 R    [        [        [           U R                  SSSUUS95      $ )!
Returns a list of credit notes.
get/v1/credit_notesapibase_addressr   r   )r   r   r   _requestr   r   r   s      r   listCreditNoteService.listr  s9     z"MM""  	
 		
r   c                 n   #    [        [        [           U R                  SSSUUS9I Sh  vN 5      $  N7f)r   r   r   r   r   N)r   r   r   _request_asyncr   s      r   
list_asyncCreditNoteService.list_async  sH      z"%%"" &  	
 		
s   (53
	5r    c                 D    [        [        U R                  SSSUUS95      $ )9  
Issue a credit note to adjust the amount of a finalized invoice. A credit note will first reduce the invoice's amount_remaining (and amount_due), but not below zero.
This amount is indicated by the credit note's pre_payment_amount. The excess amount is indicated by post_payment_amount, and it can result in any combination of the following:


Refunds: create a new refund (using refund_amount) or link existing refunds (using refunds).
Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).


The sum of refunds, customer balance credits, and outside of Stripe credits must equal the post_payment_amount.

You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount,
post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation.
postr   r   r   r   r   r   r   s      r   createCreditNoteService.create  s4    ( MM""  	
 		
r   c                 `   #    [        [        U R                  SSSUUS9I Sh  vN 5      $  N7f)r   r   r   r   r   Nr   r   r   r   s      r   create_asyncCreditNoteService.create_async  sC     ( %%"" &  	
 		
   !.,
	.idr   c                 p    [        [        U R                  SSR                  [	        U5      S9SUUS95      $ )=
Retrieves the credit note object with the given identifier.
r   /v1/credit_notes/{id}r   r   r   r   r   r   formatr	   r   r   r   r   s       r   retrieveCreditNoteService.retrieve  sF     MM'..+b/.B"  	
 		
r   c                    #    [        [        U R                  SSR                  [	        U5      S9SUUS9I Sh  vN 5      $  N7f)r   r   r   r   r   r   Nr   r   r   r   r	   r   s       r   retrieve_async CreditNoteService.retrieve_async  sU      %%'..+b/.B" &  	
 		
   7AA
	Ar   c                 p    [        [        U R                  SSR                  [	        U5      S9SUUS95      $ )"
Updates an existing credit note.
r   r   r   r   r   r   r   s       r   updateCreditNoteService.update  sF     MM'..+b/.B"  	
 		
r   c                    #    [        [        U R                  SSR                  [	        U5      S9SUUS9I Sh  vN 5      $  N7f)r   r   r   r   r   r   Nr   r   s       r   update_asyncCreditNoteService.update_async  sU      %%'..+b/.B" &  	
 		
r   r   c                 D    [        [        U R                  SSSUUS95      $ )5
Get a preview of a credit note without creating it.
r   /v1/credit_notes/previewr   r   r   r   s      r   previewCreditNoteService.preview&  s4     MM*"  	
 		
r   c                 `   #    [        [        U R                  SSSUUS9I Sh  vN 5      $  N7f)r   r   r   r   r   Nr   r   s      r   preview_asyncCreditNoteService.preview_async9  sC      %%*" &  	
 		
r   r   c                 p    [        [        U R                  SSR                  [	        U5      S9SUUS95      $ )
Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding).
r   /v1/credit_notes/{id}/voidr   r   r   r   r   s       r   void_credit_note"CreditNoteService.void_credit_noteL  sF     MM,33{23G"  	
 		
r   c                    #    [        [        U R                  SSR                  [	        U5      S9SUUS9I Sh  vN 5      $  N7f)r   r   r   r   r   r   Nr   r   s       r   void_credit_note_async(CreditNoteService.void_credit_note_async`  sU      %%,33{23G" &  	
 		
r   )r   r   )'r=   r>   r?   r@   r   r   rE   rT   r\   rc   rj   ru   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rC   r   r   r   r   r   r   r   r   rD   __classcell__)r   s   @r   r   r      s   L
Ay AF&9 &PI Y 9 Y <I $A	 AF&I &PY i I  y y  24"$
.
  
 
J		
* 24"$
.
  
 
J		
, #%
0
  
 
	
D #%
0
  
 
	
D 68"$	

 3
  	

 

. 68"$	

 3
  	

 

. 46"$	

 1
  	

 

. 46"$	

 1
  	

 

. #%
1
  
 
	
, #%
1
  
 
	
, <>"$	

 9
  	

 

. <>"$	

 9
  	

 

 
r   r   N)stripe._credit_noter   %stripe._credit_note_line_item_servicer   )stripe._credit_note_preview_lines_servicer   stripe._list_objectr   stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr	   typingr
   r   r   typing_extensionsr   r   r   r   r;   r   r   <module>r      s:    + K + 2 0 $ # # = =b	
 b	
r   