Macro api_client_macro::generate
source · macro_rules! generate { ($client_type:ident, { $( $resource:ident { $( $name:ident: $method:ident $url:literal $($param:ident : $type:ty)* ),+ } ),+ }) => { ... }; }
Expand description
easily creates an api client
api_client_macro::generate!(ApiClient, {
user {
get_by_id: get "user/{id}" id: &str,
delete_by_id: delete "user/{id}" id: &str,
create: post "user",
list: get "users"
},
contact {
get_by_id: get "contact/{id}" id: &str,
delete_by_id: delete "contact/{id}" id: &str,
create: post "contact",
list: get "contact"
}
});