Skip to main content

api_delete

Macro api_delete 

Source
macro_rules! api_delete {
    (
        $(#[$m:meta])*
        $fn_name:ident,
        $op_id:literal,
        $visibility:expr,
        $ret_type:ty,
        $( ($param:ident: $param_t:ty) => $replace:literal ),*
    ) => { ... };
    (
        $(#[$m:meta])*
        $fn_name:ident,
        $op_id:literal,
        $visibility:expr,
        $ret_type:ty,
        $( ($param:ident: $param_t:ty) => $replace:literal ),*
        $( ; $( ($qparam:ident: $qparam_t:ty) => $qreplace:literal ),+ )?
    ) => { ... };
    (
        $(#[$m:meta])*
        $fn_name:ident,
        $op_id:literal,
        $visibility:expr,
        $ret_type:ty,
        $( ($param:ident: $param_t:ty) => $replace:literal ),*
        ; $( $qkind:ident($qparam:ident: $qparam_t:ty) => $qkey:literal ),+ $(,)?
    ) => { ... };
}
Expand description

Create a function for calling a single endpoint with a DELETE request.

Follows the structure of the api_get! macro: path parameters, then required and optional query parameters. DELETE requests have no body.

ยงExample

pub struct SomeGroup<'a> {
    pub(crate) esi: &'a Esi,
}

impl SomeGroup<'_> {

    api_delete!(
        /// Docs for the generated function
        function_name,
        "some_operation_id",
        RequestType::Authenticated,
        (),
        (character_id: i64) => "{character_id}",
        (fitting_id: i32) => "{fitting_id}"
    );

}