<%
def make_type(it)
res = case it[:type]
when "integer" then
"usize"
when "enum" then
"HashSet<#{it[:name].ucc}>"
when "enum_single" then
"#{it[:name].ucc}"
when "date" then
"DateTime<Utc>"
when "bool" then
"bool"
else
"String"
end
if it[:required]
res
else
"Option<#{res}>"
end
end
%>#[derive(Debug, Clone, Default)]
pub struct Api {<% (paths + queries + form.filter{|it| it[:alter].blank? && it[:constant].blank?}).each do |it| %>
<%= it[:name].make_name.make_field %>: <%= make_type(it) %>,<% end %><% if bodies.present? %>
body: Body,<% end %>
twapi_options: Option<TwapiOptions>,
}