fsharp-functions-server.HandlerParams.mustache Maven / Gradle / Ivy
namespace {{packageName}}
{{#imports}}
{{#import}}
open {{.}}
{{/import}}
{{/imports}}
open System.Collections.Generic
open System
module {{classname}}HandlerParams =
{{#operations}}
{{#operation}}
{{#pathParams}}
{{#-first}}
//#region Path parameters
[]
type {{operationId}}PathParams = {
{{/-first}}
{{paramName}} : {{dataType}} {{^required}}option{{/required}};
{{#-last}}
}
{{/-last}}
//#endregion
{{/pathParams}}
{{#queryParams}}
{{#-first}}
//#region Query parameters
[]
type {{operationId}}QueryParams = {
{{/-first}}
{{paramName}} : {{dataType}} {{^required}}option{{/required}};
{{#-last}}
}
//#endregion
{{/-last}}
{{/queryParams}}
{{#bodyParams}}
{{#-first}}
//#region Body parameters
[]
{{#-last}}
type {{operationId}}BodyParams = {{dataType}}
{{/-last}}
{{^-last}}
type {{operationId}}BodyParams = {
{{paramName}} : {{dataType}};
{{/-last}}
{{/-first}}
{{^-first}}
{{paramName}} : {{dataType}};
{{/-first}}
{{#-last}}
{{^-first}}
}
{{/-first}}
//#endregion
{{/-last}}
{{/bodyParams}}
{{#formParams}}
//#region Form parameters
{{#-first}}
[]
type {{operationId}}FormParams = {
{{/-first}}
{{paramName}} : {{dataType}} {{^required}}option{{/required}};
{{#-last}}
}
{{/-last}}
//#endregion
{{/formParams}}
{{#headerParams}}
//#region Header parameters
{{#-first}}
[]
type {{operationId}}HeaderParams = {
{{/-first}}
{{paramName}} : {{dataType}} {{^required}}option{{/required}};
{{#-last}}
}
{{/-last}}
//#endregion
{{/headerParams}}
{{#cookieParams}}
//#region Cookie parameters
{{#-first}}
type {{operationId}}CookieParams = {
{{/-first}}
{{paramName}} : {{dataType}} {{^required}}option{{/required}};
{{#-last}}
}
{{/-last}}
//#endregion
{{/cookieParams}}
{{#responses}}
type {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response = {
content:{{{dataType}}}{{^dataType}}string{{/dataType}};
{{^code}}code:int{{/code}}
}
{{/responses}}
type {{operationId}}Result = {{#responses}}{{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} of {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response{{^-last}}|{{/-last}}{{/responses}}
{{#allParams}}
{{#-first}}
type {{operationId}}Args = {
{{/-first}}
{{/allParams}}
{{#hasHeaderParams}}
headerParams:{{operationId}}HeaderParams;
{{/hasHeaderParams}}
{{#pathParams}}
{{#-first}}
pathParams:{{operationId}}PathParams;
{{/-first}}
{{/pathParams}}
{{#queryParams}}
{{#-first}}
queryParams:Result<{{operationId}}QueryParams,string>;
{{/-first}}
{{/queryParams}}
{{#bodyParams}}
{{#-first}}
bodyParams:{{operationId}}BodyParams
{{/-first}}
{{/bodyParams}}
{{#formParams}}
{{#-first}}
formParams:Result<{{operationId}}FormParams,string>
{{/-first}}
{{/formParams}}
{{#allParams}}
{{#-first}}
}
{{/-first}}
{{/allParams}}
{{/operation}}
{{/operations}}