use eiktyrner::{content, HttpClient};
use crate::{Param, PathAndQueryBuilder, Result};

use crate::Client;
use crate::models::{
     DeliveryMethodTypeView,
     SendReminderInvoiceView,
    
};


impl Client {
    
    

/// Creates and sends a reminder invoice for the invoice. Reminder fees and PDF:s will be added to the invoice.
/// - **id**: Invoice public id
/// - **method**: The method to send the invoice
pub async fn reminder_invoice_send_the_reminder_invoice(&self,id: String,
                         method: Option<DeliveryMethodTypeView>,
                         
) -> Result<()> {


    let path_and_query = PathAndQueryBuilder::new()
        .url(Param::value("v1"))
        .url(Param::value("invoice"))
        .url(Param::value("sendreminderinvoice"))
        .url(Param::value(id))
        .query("method", Param::opt(method))
        .build();






    let request = self.new_request(
        http::method::Method::PUT,
        path_and_query,
    )
    .body(content::Empty).expect("setting json body");
    
    self.client.send::<_, content::Empty>(request).await
    
}
    
    

/// Uses a already reminder PDF generated by you and sends it. Reminder fees and PDF:s will be added to the invoice.
pub async fn reminder_invoice_send_the_reminder_invoice_with_pregenerated_pdf(&self,body: SendReminderInvoiceView,
                         
) -> Result<()> {


    let path_and_query = PathAndQueryBuilder::new()
        .url(Param::value("v1"))
        .url(Param::value("invoice"))
        .url(Param::value("sendreminderinvoice"))
        .build();






    let request = self.new_request(
        http::method::Method::PUT,
        path_and_query,
    )
    .body(content::Json(body)).expect("setting json body");
    
    self.client.send::<_, content::Empty>(request).await
    
}
    
}