mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 02:55:19 +00:00
[haskell-http-client] bug fixes; path & newtype generation issues (#6638)
* fix path generation/param-substitution issues * fix newtype de-duplication issues * refactoring only * correct version in comments * prevent duplicate MimeTypes * sort parameter newtypes
This commit is contained in:
parent
dc88ed99ae
commit
db67840ded
@ -26,7 +26,6 @@ import java.io.File;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
@ -34,7 +33,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
|
||||
// source folder where to write the files
|
||||
protected String sourceFolder = "src";
|
||||
protected String apiVersion = "0.0.1";
|
||||
|
||||
protected String artifactId = "swagger-haskell-http-client";
|
||||
protected String artifactVersion = "1.0.0";
|
||||
@ -67,7 +65,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
|
||||
protected Map<String, CodegenParameter> uniqueParamsByName = new HashMap<String, CodegenParameter>();
|
||||
protected Set<String> typeNames = new HashSet<String>();
|
||||
protected Map<String, Map<String,String>> allMimeTypes = new HashMap<String, Map<String,String>>();
|
||||
protected Map<String, String> knownMimeDataTypes = new HashMap<String, String>();
|
||||
protected Map<String, Set<String>> modelMimeTypes = new HashMap<String, Set<String>>();
|
||||
protected String lastTag = "";
|
||||
@ -124,7 +121,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
)
|
||||
);
|
||||
|
||||
additionalProperties.put("apiVersion", apiVersion);
|
||||
additionalProperties.put("artifactId", artifactId);
|
||||
additionalProperties.put("artifactVersion", artifactVersion);
|
||||
|
||||
@ -398,13 +394,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
additionalProperties.put("configType", apiName + "Config");
|
||||
additionalProperties.put("swaggerVersion", swagger.getSwagger());
|
||||
|
||||
//copy input swagger to output folder
|
||||
try {
|
||||
String swaggerJson = Json.pretty(swagger);
|
||||
FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e.getMessage(), e.getCause());
|
||||
}
|
||||
WriteInputSwaggerToFile(swagger);
|
||||
|
||||
super.preprocessSwagger(swagger);
|
||||
}
|
||||
@ -461,7 +451,6 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CodegenOperation fromOperation(String resourcePath, String httpMethod, Operation operation, Map<String, Model> definitions, Swagger swagger) {
|
||||
CodegenOperation op = super.fromOperation(resourcePath, httpMethod, operation, definitions, swagger);
|
||||
@ -486,100 +475,20 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
if(!param.required) {
|
||||
op.vendorExtensions.put("x-hasOptionalParams", true);
|
||||
}
|
||||
if (typeMapping.containsKey(param.dataType) || param.isPrimitiveType || param.isListContainer || param.isMapContainer || param.isFile) {
|
||||
String paramNameType = toTypeName("Param", param.paramName);
|
||||
|
||||
if (uniqueParamsByName.containsKey(paramNameType)) {
|
||||
CodegenParameter lastParam = this.uniqueParamsByName.get(paramNameType);
|
||||
if (lastParam.dataType != null && lastParam.dataType.equals(param.dataType)) {
|
||||
param.vendorExtensions.put("x-duplicate", true);
|
||||
} else {
|
||||
paramNameType = paramNameType + param.dataType;
|
||||
while (typeNames.contains(paramNameType)) {
|
||||
paramNameType = generateNextName(paramNameType);
|
||||
}
|
||||
uniqueParamsByName.put(paramNameType, param);
|
||||
}
|
||||
} else {
|
||||
while (typeNames.contains(paramNameType)) {
|
||||
paramNameType = generateNextName(paramNameType);
|
||||
}
|
||||
uniqueParamsByName.put(paramNameType, param);
|
||||
}
|
||||
|
||||
param.vendorExtensions.put("x-paramNameType", paramNameType);
|
||||
typeNames.add(paramNameType);
|
||||
}
|
||||
}
|
||||
if (op.getHasPathParams()) {
|
||||
String remainingPath = op.path;
|
||||
for (CodegenParameter param : op.pathParams) {
|
||||
String[] pieces = remainingPath.split("\\{" + param.baseName + "\\}");
|
||||
if (pieces.length == 0)
|
||||
throw new RuntimeException("paramName {" + param.baseName + "} not in path " + op.path);
|
||||
if (pieces.length > 2)
|
||||
throw new RuntimeException("paramName {" + param.baseName + "} found multiple times in path " + op.path);
|
||||
if (pieces.length == 2) {
|
||||
param.vendorExtensions.put("x-pathPrefix", pieces[0]);
|
||||
remainingPath = pieces[1];
|
||||
} else {
|
||||
if (remainingPath.startsWith("{" + param.baseName + "}")) {
|
||||
remainingPath = pieces[0];
|
||||
} else {
|
||||
param.vendorExtensions.put("x-pathPrefix", pieces[0]);
|
||||
remainingPath = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
op.vendorExtensions.put("x-hasPathParams", true);
|
||||
if (remainingPath.length() > 0) {
|
||||
op.vendorExtensions.put("x-pathSuffix", remainingPath);
|
||||
}
|
||||
} else {
|
||||
op.vendorExtensions.put("x-hasPathParams", false);
|
||||
op.vendorExtensions.put("x-pathSuffix", op.path);
|
||||
}
|
||||
for (CodegenParameter param : op.queryParams) {
|
||||
}
|
||||
for (CodegenParameter param : op.headerParams) {
|
||||
}
|
||||
for (CodegenParameter param : op.bodyParams) {
|
||||
}
|
||||
for (CodegenParameter param : op.formParams) {
|
||||
deduplicateParameter(param);
|
||||
}
|
||||
|
||||
if (op.hasConsumes) {
|
||||
for (Map<String, String> m : op.consumes) {
|
||||
processMediaType(op,m);
|
||||
}
|
||||
if (isMultipartOperation(op.consumes)) {
|
||||
op.isMultipart = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
if (op.hasProduces) {
|
||||
for (Map<String, String> m : op.produces) {
|
||||
processMediaType(op,m);
|
||||
}
|
||||
}
|
||||
processPathExpr(op);
|
||||
|
||||
String returnType = op.returnType;
|
||||
if (returnType == null || returnType.equals("null")) {
|
||||
if(op.hasProduces) {
|
||||
returnType = "res";
|
||||
op.vendorExtensions.put("x-hasUnknownReturn", true);
|
||||
} else {
|
||||
returnType = "NoContent";
|
||||
}
|
||||
}
|
||||
if (returnType.indexOf(" ") >= 0) {
|
||||
returnType = "(" + returnType + ")";
|
||||
}
|
||||
op.vendorExtensions.put("x-returnType", returnType);
|
||||
processProducesConsumes(op);
|
||||
|
||||
processReturnType(op);
|
||||
|
||||
return op;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CodegenSecurity> fromSecurity(Map<String, SecuritySchemeDefinition> schemes) {
|
||||
List<CodegenSecurity> secs = super.fromSecurity(schemes);
|
||||
for(CodegenSecurity sec : secs) {
|
||||
@ -603,8 +512,26 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
}
|
||||
|
||||
additionalProperties.put("x-hasUnknownMimeTypes", !unknownMimeTypes.isEmpty());
|
||||
|
||||
Collections.sort(unknownMimeTypes, new Comparator<Map<String, String>>() {
|
||||
@Override
|
||||
public int compare(Map<String, String> o1, Map<String, String> o2) {
|
||||
return o1.get(MEDIA_TYPE).compareTo(o2.get(MEDIA_TYPE));
|
||||
}
|
||||
});
|
||||
additionalProperties.put("x-unknownMimeTypes", unknownMimeTypes);
|
||||
additionalProperties.put("x-allUniqueParams", uniqueParamsByName.values());
|
||||
|
||||
ArrayList<CodegenParameter> params = new ArrayList<>(uniqueParamsByName.values());
|
||||
Collections.sort(params, new Comparator<CodegenParameter>() {
|
||||
@Override
|
||||
public int compare(CodegenParameter o1, CodegenParameter o2) {
|
||||
return
|
||||
((String) o1.vendorExtensions.get("x-paramNameType"))
|
||||
.compareTo(
|
||||
(String) o2.vendorExtensions.get("x-paramNameType"));
|
||||
}
|
||||
});
|
||||
additionalProperties.put("x-allUniqueParams", params);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -687,10 +614,114 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
return dataType != null && dataType.equals("B.ByteString");
|
||||
}
|
||||
|
||||
//copy input swagger to output folder
|
||||
private void WriteInputSwaggerToFile(Swagger swagger) {
|
||||
try {
|
||||
String swaggerJson = Json.pretty(swagger);
|
||||
FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e.getMessage(), e.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
private void processReturnType(CodegenOperation op) {
|
||||
String returnType = op.returnType;
|
||||
if (returnType == null || returnType.equals("null")) {
|
||||
if(op.hasProduces) {
|
||||
returnType = "res";
|
||||
op.vendorExtensions.put("x-hasUnknownReturn", true);
|
||||
} else {
|
||||
returnType = "NoContent";
|
||||
}
|
||||
}
|
||||
if (returnType.indexOf(" ") >= 0) {
|
||||
returnType = "(" + returnType + ")";
|
||||
}
|
||||
op.vendorExtensions.put("x-returnType", returnType);
|
||||
}
|
||||
|
||||
private void processProducesConsumes(CodegenOperation op) {
|
||||
if (op.hasConsumes) {
|
||||
for (Map<String, String> m : op.consumes) {
|
||||
processMediaType(op,m);
|
||||
}
|
||||
if (isMultipartOperation(op.consumes)) {
|
||||
op.isMultipart = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
if (op.hasProduces) {
|
||||
for (Map<String, String> m : op.produces) {
|
||||
processMediaType(op,m);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void deduplicateParameter(CodegenParameter param) {
|
||||
if (typeMapping.containsKey(param.dataType) || param.isPrimitiveType || param.isListContainer || param.isMapContainer || param.isFile) {
|
||||
|
||||
String paramNameType = toTypeName("Param", param.paramName);
|
||||
|
||||
if (uniqueParamsByName.containsKey(paramNameType)) {
|
||||
if(!checkParamForDuplicates(paramNameType, param)) {
|
||||
paramNameType = paramNameType + param.dataType;
|
||||
if(!checkParamForDuplicates(paramNameType, param)) {
|
||||
while (typeNames.contains(paramNameType)) {
|
||||
paramNameType = generateNextName(paramNameType);
|
||||
if(checkParamForDuplicates(paramNameType, param)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uniqueParamsByName.put(paramNameType, param);
|
||||
}
|
||||
} else {
|
||||
|
||||
while (typeNames.contains(paramNameType)) {
|
||||
paramNameType = generateNextName(paramNameType);
|
||||
if(checkParamForDuplicates(paramNameType, param)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uniqueParamsByName.put(paramNameType, param);
|
||||
}
|
||||
|
||||
param.vendorExtensions.put("x-paramNameType", paramNameType);
|
||||
typeNames.add(paramNameType);
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean checkParamForDuplicates(String paramNameType, CodegenParameter param) {
|
||||
CodegenParameter lastParam = this.uniqueParamsByName.get(paramNameType);
|
||||
if (lastParam != null && lastParam.dataType != null && lastParam.dataType.equals(param.dataType)) {
|
||||
param.vendorExtensions.put("x-duplicate", true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// build the parameterized path segments, according to pathParams
|
||||
private void processPathExpr(CodegenOperation op) {
|
||||
String xPath = "[\"" + escapeText(op.path) + "\"]";
|
||||
if (op.getHasPathParams()) {
|
||||
for (CodegenParameter param : op.pathParams) {
|
||||
xPath = xPath.replaceAll("\\{" + param.baseName + "\\}", "\",toPath " + param.paramName + ",\"");
|
||||
}
|
||||
xPath = xPath.replaceAll(",\"\",", ",");
|
||||
xPath = xPath.replaceAll("\"\",", ",");
|
||||
xPath = xPath.replaceAll(",\"\"", ",");
|
||||
xPath = xPath.replaceAll("^\\[,", "[");
|
||||
xPath = xPath.replaceAll(",\\]$", "]");
|
||||
}
|
||||
op.vendorExtensions.put("x-path", xPath);
|
||||
}
|
||||
|
||||
|
||||
private void processMediaType(CodegenOperation op, Map<String, String> m) {
|
||||
String mediaType = m.get(MEDIA_TYPE);
|
||||
|
||||
if(StringUtils.isBlank(mediaType)) return;
|
||||
if (StringUtils.isBlank(mediaType)) return;
|
||||
|
||||
String mimeType = getMimeDataType(mediaType);
|
||||
typeNames.add(mimeType);
|
||||
@ -699,8 +730,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
m.put(MEDIA_IS_JSON, "true");
|
||||
}
|
||||
|
||||
allMimeTypes.put(mediaType, m);
|
||||
if(!knownMimeDataTypes.containsKey(mediaType) && !unknownMimeTypes.contains(m)) {
|
||||
if (!knownMimeDataTypes.containsValue(mimeType) && !unknownMimeTypesContainsType(mimeType)) {
|
||||
unknownMimeTypes.add(m);
|
||||
}
|
||||
for (CodegenParameter param : op.allParams) {
|
||||
@ -712,6 +742,17 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
}
|
||||
}
|
||||
|
||||
private Boolean unknownMimeTypesContainsType(String mimeType) {
|
||||
for(Map<String,String> m : unknownMimeTypes) {
|
||||
String mimeType0 = m.get(MEDIA_DATA_TYPE);
|
||||
if(mimeType0 != null && mimeType0.equals(mimeType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public String firstLetterToUpper(String word) {
|
||||
if (word.length() == 0) {
|
||||
return word;
|
||||
|
@ -88,9 +88,14 @@ import qualified Prelude as P
|
||||
-> {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#vendorExtensions.x-paramNameType}}{{{.}}}{{/vendorExtensions.x-paramNameType}}{{^vendorExtensions.x-paramNameType}}{{{dataType}}}{{/vendorExtensions.x-paramNameType}} -- ^ "{{{paramName}}}"{{#description}} - {{/description}} {{{description}}}
|
||||
-> {{/required}}{{/allParams}}{{requestType}} {{{vendorExtensions.x-operationType}}} {{#vendorExtensions.x-hasBodyOrFormParam}}contentType{{/vendorExtensions.x-hasBodyOrFormParam}}{{^vendorExtensions.x-hasBodyOrFormParam}}MimeNoContent{{/vendorExtensions.x-hasBodyOrFormParam}} {{vendorExtensions.x-returnType}}
|
||||
{{operationId}} {{#vendorExtensions.x-hasBodyOrFormParam}}_ {{/vendorExtensions.x-hasBodyOrFormParam}}{{#allParams}}{{#required}}{{#isBodyParam}}{{{paramName}}}{{/isBodyParam}}{{^isBodyParam}}({{{vendorExtensions.x-paramNameType}}} {{{paramName}}}){{/isBodyParam}} {{/required}}{{/allParams}}=
|
||||
_mkRequest "{{httpMethod}}" [{{#pathParams}}{{#vendorExtensions.x-pathPrefix}}"{{.}}",{{/vendorExtensions.x-pathPrefix}}toPath {{{paramName}}}{{#hasMore}},{{/hasMore}}{{/pathParams}}{{#vendorExtensions.x-pathSuffix}}{{#vendorExtensions.x-hasPathParams}},{{/vendorExtensions.x-hasPathParams}}"{{.}}"{{/vendorExtensions.x-pathSuffix}}]{{#allParams}}{{#required}}
|
||||
{{#isHeaderParam}}`setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}}`setQuery` {{>_queryColl}} ("{{{baseName}}}", Just {{{paramName}}}){{/isQueryParam}}{{#isFormParam}}{{#isFile}}`_addMultiFormPart` NH.partFileSource "{{{baseName}}}" {{{paramName}}}{{/isFile}}{{^isFile}}{{#isMultipart}}`_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData {{{paramName}}}){{/isMultipart}}{{^isMultipart}}`addForm` {{>_formColl}} ("{{{baseName}}}", {{{paramName}}}){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{#isBodyParam}}`setBodyParam` {{{paramName}}}{{/isBodyParam}}{{/required}}{{/allParams}}{{#authMethods}}
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#isDeprecated}}
|
||||
_mkRequest "{{httpMethod}}" {{{vendorExtensions.x-path}}}{{#authMethods}}
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy {{name}}){{/authMethods}}{{#allParams}}{{#required}}{{#isHeaderParam}}
|
||||
`setHeader` {{>_headerColl}} ("{{{baseName}}}", {{{paramName}}}){{/isHeaderParam}}{{#isQueryParam}}
|
||||
`setQuery` {{>_queryColl}} ("{{{baseName}}}", Just {{{paramName}}}){{/isQueryParam}}{{#isFormParam}}{{#isFile}}
|
||||
`_addMultiFormPart` NH.partFileSource "{{{baseName}}}" {{{paramName}}}{{/isFile}}{{^isFile}}{{#isMultipart}}
|
||||
`_addMultiFormPart` NH.partLBS "{{{baseName}}}" (mimeRender' MimeMultipartFormData {{{paramName}}}){{/isMultipart}}{{^isMultipart}}
|
||||
`addForm` {{>_formColl}} ("{{{baseName}}}", {{{paramName}}}){{/isMultipart}}{{/isFile}}{{/isFormParam}}{{#isBodyParam}}
|
||||
`setBodyParam` {{{paramName}}}{{/isBodyParam}}{{/required}}{{/allParams}}{{#isDeprecated}}
|
||||
|
||||
{-# DEPRECATED {{operationId}} "" #-}{{/isDeprecated}}
|
||||
|
||||
@ -138,13 +143,6 @@ class HasOptionalParam req param where
|
||||
|
||||
infixl 2 -&-
|
||||
|
||||
-- * Request Parameter Types
|
||||
|
||||
{{#x-allUniqueParams}}
|
||||
-- | {{{vendorExtensions.x-paramNameType}}}
|
||||
newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}})
|
||||
{{/x-allUniqueParams}}
|
||||
|
||||
-- * {{requestType}}
|
||||
|
||||
-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
|
||||
|
@ -113,6 +113,12 @@ mk{{classname}} {{#requiredVars}}{{name}} {{/requiredVars}}=
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
|
||||
-- * Parameter newtypes
|
||||
|
||||
{{#x-allUniqueParams}}
|
||||
newtype {{{vendorExtensions.x-paramNameType}}} = {{{vendorExtensions.x-paramNameType}}} { un{{{vendorExtensions.x-paramNameType}}} :: {{{dataType}}} } deriving (P.Eq, P.Show{{#isBodyParam}}, A.ToJSON{{/isBodyParam}})
|
||||
{{/x-allUniqueParams}}
|
||||
|
||||
-- * Utils
|
||||
|
||||
-- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)
|
||||
|
@ -1,7 +1,3 @@
|
||||
-- This file has been generated from package.yaml by hpack version 0.17.1.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
|
||||
name: {{package}}
|
||||
version: 0.1.0.0
|
||||
synopsis: Auto-generated {{package}} API Client
|
||||
@ -11,10 +7,12 @@ description: .
|
||||
host: {{host}}
|
||||
.
|
||||
base path: {{basePath}}
|
||||
{{#version}}
|
||||
.
|
||||
apiVersion: {{apiVersion}}
|
||||
{{appName}} API version: {{{.}}}
|
||||
{{/version}}
|
||||
.
|
||||
swagger version: {{swaggerVersion}}
|
||||
OpenAPI spec version: {{swaggerVersion}}
|
||||
.
|
||||
{{^hideGenerationTimestamp}}Generated on: {{generatedDate}}
|
||||
.
|
||||
|
@ -1,17 +1,20 @@
|
||||
{-
|
||||
{{#appName}}
|
||||
{{{appName}}}
|
||||
{{{.}}}
|
||||
|
||||
{{/appName}}
|
||||
{{#appDescription}}
|
||||
{{{appDescription}}}
|
||||
{{#appDescription}}
|
||||
{{{.}}}
|
||||
|
||||
{{/appDescription}}
|
||||
{{#swaggerVersion}}
|
||||
OpenAPI spec version: {{{.}}}
|
||||
{{/swaggerVersion}}
|
||||
{{#version}}
|
||||
OpenAPI spec version: {{{version}}}
|
||||
{{appName}} API version: {{{.}}}
|
||||
{{/version}}
|
||||
{{#infoEmail}}
|
||||
Contact: {{{infoEmail}}}
|
||||
Contact: {{{.}}}
|
||||
{{/infoEmail}}
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - B)</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
|
||||
window.onload = function () {pageLoad();};
|
||||
//]]>
|
||||
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client</p></div><div id="content"><div id="alphabet"><ul><li><a href="doc-index-A.html">A</a></li><li><a href="doc-index-B.html">B</a></li><li><a href="doc-index-C.html">C</a></li><li><a href="doc-index-D.html">D</a></li><li><a href="doc-index-E.html">E</a></li><li><a href="doc-index-F.html">F</a></li><li><a href="doc-index-G.html">G</a></li><li><a href="doc-index-H.html">H</a></li><li><a href="doc-index-I.html">I</a></li><li><a href="doc-index-L.html">L</a></li><li><a href="doc-index-M.html">M</a></li><li><a href="doc-index-N.html">N</a></li><li><a href="doc-index-O.html">O</a></li><li><a href="doc-index-P.html">P</a></li><li><a href="doc-index-R.html">R</a></li><li><a href="doc-index-S.html">S</a></li><li><a href="doc-index-T.html">T</a></li><li><a href="doc-index-U.html">U</a></li><li><a href="doc-index-W.html">W</a></li><li><a href="doc-index-45.html">-</a></li><li><a href="doc-index-95.html">_</a></li><li><a href="doc-index-All.html">All</a></li></ul></div><div id="index"><p class="caption">Index - B</p><table><tr><td class="src">Binary</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:Binary">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:Binary">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="src">Body</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-API.html#t:Body">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-API.html#v:Body">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="src">Byte</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-API.html#t:Byte">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-API.html#v:Byte">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="src">ByteArray</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:ByteArray">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:ByteArray">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|
||||
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client</p></div><div id="content"><div id="alphabet"><ul><li><a href="doc-index-A.html">A</a></li><li><a href="doc-index-B.html">B</a></li><li><a href="doc-index-C.html">C</a></li><li><a href="doc-index-D.html">D</a></li><li><a href="doc-index-E.html">E</a></li><li><a href="doc-index-F.html">F</a></li><li><a href="doc-index-G.html">G</a></li><li><a href="doc-index-H.html">H</a></li><li><a href="doc-index-I.html">I</a></li><li><a href="doc-index-L.html">L</a></li><li><a href="doc-index-M.html">M</a></li><li><a href="doc-index-N.html">N</a></li><li><a href="doc-index-O.html">O</a></li><li><a href="doc-index-P.html">P</a></li><li><a href="doc-index-R.html">R</a></li><li><a href="doc-index-S.html">S</a></li><li><a href="doc-index-T.html">T</a></li><li><a href="doc-index-U.html">U</a></li><li><a href="doc-index-W.html">W</a></li><li><a href="doc-index-45.html">-</a></li><li><a href="doc-index-95.html">_</a></li><li><a href="doc-index-All.html">All</a></li></ul></div><div id="index"><p class="caption">Index - B</p><table><tr><td class="src">Binary</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:Binary">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:Binary">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="src">Body</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:Body">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:Body">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="src">Byte</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:Byte">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:Byte">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="src">ByteArray</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:ByteArray">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:ByteArray">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client (Index - I)</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
|
||||
window.onload = function () {pageLoad();};
|
||||
//]]>
|
||||
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client</p></div><div id="content"><div id="alphabet"><ul><li><a href="doc-index-A.html">A</a></li><li><a href="doc-index-B.html">B</a></li><li><a href="doc-index-C.html">C</a></li><li><a href="doc-index-D.html">D</a></li><li><a href="doc-index-E.html">E</a></li><li><a href="doc-index-F.html">F</a></li><li><a href="doc-index-G.html">G</a></li><li><a href="doc-index-H.html">H</a></li><li><a href="doc-index-I.html">I</a></li><li><a href="doc-index-L.html">L</a></li><li><a href="doc-index-M.html">M</a></li><li><a href="doc-index-N.html">N</a></li><li><a href="doc-index-O.html">O</a></li><li><a href="doc-index-P.html">P</a></li><li><a href="doc-index-R.html">R</a></li><li><a href="doc-index-S.html">S</a></li><li><a href="doc-index-T.html">T</a></li><li><a href="doc-index-U.html">U</a></li><li><a href="doc-index-W.html">W</a></li><li><a href="doc-index-45.html">-</a></li><li><a href="doc-index-95.html">_</a></li><li><a href="doc-index-All.html">All</a></li></ul></div><div id="index"><p class="caption">Index - I</p><table><tr><td class="src">initLogContext</td><td class="module"><a href="SwaggerPetstore-Logging.html#v:initLogContext">SwaggerPetstore.Logging</a>, SwaggerPetstore</td></tr><tr><td class="src">InitRequest</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Client.html#t:InitRequest">SwaggerPetstore.Client</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Client.html#v:InitRequest">SwaggerPetstore.Client</a>, SwaggerPetstore</td></tr><tr><td class="src">Int32</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-API.html#t:Int32">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-API.html#v:Int32">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="src">Int64</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-API.html#t:Int64">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-API.html#v:Int64">SwaggerPetstore.API</a>, SwaggerPetstore</td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|
||||
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client</p></div><div id="content"><div id="alphabet"><ul><li><a href="doc-index-A.html">A</a></li><li><a href="doc-index-B.html">B</a></li><li><a href="doc-index-C.html">C</a></li><li><a href="doc-index-D.html">D</a></li><li><a href="doc-index-E.html">E</a></li><li><a href="doc-index-F.html">F</a></li><li><a href="doc-index-G.html">G</a></li><li><a href="doc-index-H.html">H</a></li><li><a href="doc-index-I.html">I</a></li><li><a href="doc-index-L.html">L</a></li><li><a href="doc-index-M.html">M</a></li><li><a href="doc-index-N.html">N</a></li><li><a href="doc-index-O.html">O</a></li><li><a href="doc-index-P.html">P</a></li><li><a href="doc-index-R.html">R</a></li><li><a href="doc-index-S.html">S</a></li><li><a href="doc-index-T.html">T</a></li><li><a href="doc-index-U.html">U</a></li><li><a href="doc-index-W.html">W</a></li><li><a href="doc-index-45.html">-</a></li><li><a href="doc-index-95.html">_</a></li><li><a href="doc-index-All.html">All</a></li></ul></div><div id="index"><p class="caption">Index - I</p><table><tr><td class="src">initLogContext</td><td class="module"><a href="SwaggerPetstore-Logging.html#v:initLogContext">SwaggerPetstore.Logging</a>, SwaggerPetstore</td></tr><tr><td class="src">InitRequest</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Client.html#t:InitRequest">SwaggerPetstore.Client</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Client.html#v:InitRequest">SwaggerPetstore.Client</a>, SwaggerPetstore</td></tr><tr><td class="src">Int32</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:Int32">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:Int32">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="src">Int64</td><td> </td></tr><tr><td class="alt">1 (Type/Class)</td><td class="module"><a href="SwaggerPetstore-Model.html#t:Int64">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr><tr><td class="alt">2 (Data Constructor)</td><td class="module"><a href="SwaggerPetstore-Model.html#v:Int64">SwaggerPetstore.Model</a>, SwaggerPetstore</td></tr></table></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,4 +2,4 @@
|
||||
window.onload = function () {pageLoad();};
|
||||
//]]>
|
||||
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client</p></div><div id="content"><div id="description"><h1>swagger-petstore-0.1.0.0: Auto-generated swagger-petstore API Client</h1><div class="doc"><p>.
|
||||
Client library for calling the swagger-petstore API based on http-client.</p><p>host: petstore.swagger.io:80</p><p>base path: <a href="http://petstore.swagger.io:80/v2">http://petstore.swagger.io:80/v2</a></p><p>apiVersion: 0.0.1</p><p>swagger version: 2.0</p><p>OpenAPI-Specification: <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md">https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md</a></p></div></div><div id="module-list"><p class="caption">Modules</p><ul><li><span class="module"><span id="control.n.1" class="collapser" onclick="toggleSection('n.1')"> </span><a href="SwaggerPetstore.html">SwaggerPetstore</a></span><ul id="section.n.1" class="show"><li><span class="module"><a href="SwaggerPetstore-API.html">SwaggerPetstore.API</a></span></li><li><span class="module"><a href="SwaggerPetstore-Client.html">SwaggerPetstore.Client</a></span></li><li><span class="module"><a href="SwaggerPetstore-Lens.html">SwaggerPetstore.Lens</a></span></li><li><span class="module"><a href="SwaggerPetstore-Logging.html">SwaggerPetstore.Logging</a></span></li><li><span class="module"><a href="SwaggerPetstore-MimeTypes.html">SwaggerPetstore.MimeTypes</a></span></li><li><span class="module"><a href="SwaggerPetstore-Model.html">SwaggerPetstore.Model</a></span></li></ul></li></ul></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|
||||
Client library for calling the swagger-petstore API based on http-client.</p><p>host: petstore.swagger.io:80</p><p>base path: <a href="http://petstore.swagger.io:80/v2">http://petstore.swagger.io:80/v2</a></p><p>Swagger Petstore API version: 1.0.0</p><p>OpenAPI spec version: 2.0</p><p>OpenAPI-Specification: <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md">https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md</a></p></div></div><div id="module-list"><p class="caption">Modules</p><ul><li><span class="module"><span id="control.n.1" class="collapser" onclick="toggleSection('n.1')"> </span><a href="SwaggerPetstore.html">SwaggerPetstore</a></span><ul id="section.n.1" class="show"><li><span class="module"><a href="SwaggerPetstore-API.html">SwaggerPetstore.API</a></span></li><li><span class="module"><a href="SwaggerPetstore-Client.html">SwaggerPetstore.Client</a></span></li><li><span class="module"><a href="SwaggerPetstore-Lens.html">SwaggerPetstore.Lens</a></span></li><li><span class="module"><a href="SwaggerPetstore-Logging.html">SwaggerPetstore.Logging</a></span></li><li><span class="module"><a href="SwaggerPetstore-MimeTypes.html">SwaggerPetstore.MimeTypes</a></span></li><li><span class="module"><a href="SwaggerPetstore-Model.html">SwaggerPetstore.Model</a></span></li></ul></li></ul></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>
|
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>SwaggerPetstore.MimeTypes</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
|
||||
window.onload = function () {pageLoad();};
|
||||
//]]>
|
||||
</script></head><body id="mini"><div id="module-header"><p class="caption">SwaggerPetstore.MimeTypes</p></div><div id="interface"><h1>Content Negotiation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:NoContent" target="main">NoContent</a></p></div><h2>Mime Types</h2><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeJSON" target="main">MimeJSON</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeXML" target="main">MimeXML</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimePlainText" target="main">MimePlainText</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeFormUrlEncoded" target="main">MimeFormUrlEncoded</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeMultipartFormData" target="main">MimeMultipartFormData</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeOctetStream" target="main">MimeOctetStream</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeNoContent" target="main">MimeNoContent</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeAny" target="main">MimeAny</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeXmlCharsetutf8" target="main">MimeXmlCharsetutf8</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeJsonCharsetutf8" target="main">MimeJsonCharsetutf8</a></p></div><h2>MimeType Class</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeType" target="main">MimeType</a> mtype</p></div><h2>MimeType Instances</h2><h2>MimeRender Class</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeRender" target="main">MimeRender</a> mtype x</p></div><h2>MimeRender Instances</h2><div class="top"><p class="src"><a href="SwaggerPetstore-MimeTypes.html#v:mimeRenderDefaultMultipartFormData" target="main">mimeRenderDefaultMultipartFormData</a></p></div><h2>MimeUnrender Class</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeUnrender" target="main">MimeUnrender</a> mtype o</p></div><h2>MimeUnrender Instances</h2><h2>Request Consumes</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:Consumes" target="main">Consumes</a> req mtype</p></div><h2>Request Produces</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:Produces" target="main">Produces</a> req mtype</p></div></div></body></html>
|
||||
</script></head><body id="mini"><div id="module-header"><p class="caption">SwaggerPetstore.MimeTypes</p></div><div id="interface"><h1>Content Negotiation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:NoContent" target="main">NoContent</a></p></div><h2>Mime Types</h2><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeJSON" target="main">MimeJSON</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeXML" target="main">MimeXML</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimePlainText" target="main">MimePlainText</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeFormUrlEncoded" target="main">MimeFormUrlEncoded</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeMultipartFormData" target="main">MimeMultipartFormData</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeOctetStream" target="main">MimeOctetStream</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeNoContent" target="main">MimeNoContent</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeAny" target="main">MimeAny</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeJsonCharsetutf8" target="main">MimeJsonCharsetutf8</a></p></div><div class="top"><p class="src"><span class="keyword">data</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeXmlCharsetutf8" target="main">MimeXmlCharsetutf8</a></p></div><h2>MimeType Class</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeType" target="main">MimeType</a> mtype</p></div><h2>MimeType Instances</h2><h2>MimeRender Class</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeRender" target="main">MimeRender</a> mtype x</p></div><h2>MimeRender Instances</h2><div class="top"><p class="src"><a href="SwaggerPetstore-MimeTypes.html#v:mimeRenderDefaultMultipartFormData" target="main">mimeRenderDefaultMultipartFormData</a></p></div><h2>MimeUnrender Class</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:MimeUnrender" target="main">MimeUnrender</a> mtype o</p></div><h2>MimeUnrender Instances</h2><h2>Request Consumes</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:Consumes" target="main">Consumes</a> req mtype</p></div><h2>Request Produces</h2><div class="top"><p class="src"><span class="keyword">class</span> <a href="SwaggerPetstore-MimeTypes.html#t:Produces" target="main">Produces</a> req mtype</p></div></div></body></html>
|
File diff suppressed because one or more lines are too long
@ -15,7 +15,7 @@
|
||||
</span><a name="line-15"></a><span class="hs-cpp">#if defined(VERSION_base)</span><span>
|
||||
</span><a name="line-16"></a><span>
|
||||
</span><a name="line-17"></a><span class="hs-cpp">#if MIN_VERSION_base(4,0,0)</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-identifier">catchIO</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="#local-6989586621679170528"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Exception</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">IOException</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="#local-6989586621679170528"><span class="hs-identifier hs-type">a</span></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="#local-6989586621679170528"><span class="hs-identifier hs-type">a</span></a><span>
|
||||
</span><a name="line-18"></a><span class="hs-identifier">catchIO</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="#local-6989586621679170526"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Exception</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">IOException</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="#local-6989586621679170526"><span class="hs-identifier hs-type">a</span></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="#local-6989586621679170526"><span class="hs-identifier hs-type">a</span></a><span>
|
||||
</span><a name="line-19"></a><span class="hs-cpp">#else</span><span>
|
||||
</span><a name="line-20"></a><span class="hs-identifier">catchIO</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Exception</span><span class="hs-operator">.</span><span class="hs-identifier">Exception</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span>
|
||||
</span><a name="line-21"></a><span class="hs-cpp">#endif</span><span>
|
||||
@ -45,7 +45,7 @@
|
||||
</span><a name="line-45"></a><a name="getSysconfDir"><a href="Paths_swagger_petstore.html#getSysconfDir"><span class="hs-identifier">getSysconfDir</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="Paths_swagger_petstore.html#catchIO"><span class="hs-identifier hs-var">catchIO</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">getEnv</span><span> </span><span class="hs-string">"swagger_petstore_sysconfdir"</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">return</span><span> </span><a href="Paths_swagger_petstore.html#sysconfdir"><span class="hs-identifier hs-var">sysconfdir</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-46"></a><span>
|
||||
</span><a name="line-47"></a><span class="hs-identifier">getDataFileName</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">FilePath</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-identifier hs-type">FilePath</span><span>
|
||||
</span><a name="line-48"></a><a name="getDataFileName"><a href="Paths_swagger_petstore.html#getDataFileName"><span class="hs-identifier">getDataFileName</span></a></a><span> </span><a name="local-6989586621679170854"><a href="#local-6989586621679170854"><span class="hs-identifier">name</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-49"></a><span> </span><a name="local-6989586621679170855"><a href="#local-6989586621679170855"><span class="hs-identifier">dir</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="Paths_swagger_petstore.html#getDataDir"><span class="hs-identifier hs-var">getDataDir</span></a><span>
|
||||
</span><a name="line-50"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679170855"><span class="hs-identifier hs-var">dir</span></a><span> </span><span class="hs-operator hs-var">++</span><span> </span><span class="hs-string">"/"</span><span> </span><span class="hs-operator hs-var">++</span><span> </span><a href="#local-6989586621679170854"><span class="hs-identifier hs-var">name</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-48"></a><a name="getDataFileName"><a href="Paths_swagger_petstore.html#getDataFileName"><span class="hs-identifier">getDataFileName</span></a></a><span> </span><a name="local-6989586621679170852"><a href="#local-6989586621679170852"><span class="hs-identifier">name</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-49"></a><span> </span><a name="local-6989586621679170853"><a href="#local-6989586621679170853"><span class="hs-identifier">dir</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="Paths_swagger_petstore.html#getDataDir"><span class="hs-identifier hs-var">getDataDir</span></a><span>
|
||||
</span><a name="line-50"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679170853"><span class="hs-identifier hs-var">dir</span></a><span> </span><span class="hs-operator hs-var">++</span><span> </span><span class="hs-string">"/"</span><span> </span><span class="hs-operator hs-var">++</span><span> </span><a href="#local-6989586621679170852"><span class="hs-identifier hs-var">name</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-51"></a></pre></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -3,294 +3,295 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}</span><span>
|
||||
</span><a name="line-10"></a><span>
|
||||
</span><a name="line-11"></a><span class="hs-comment">{-|
|
||||
</span><a name="line-11"></a><span>
|
||||
</span><a name="line-12"></a><span class="hs-comment">{-|
|
||||
Module : SwaggerPetstore.Client
|
||||
-}</span><span>
|
||||
</span><a name="line-14"></a><span>
|
||||
</span><a name="line-15"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
|
||||
</span><a name="line-16"></a><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
|
||||
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
|
||||
</span><a name="line-19"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
||||
</span><a name="line-20"></a><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
|
||||
</span><a name="line-21"></a><span class="hs-pragma">{-# LANGUAGE DeriveFoldable #-}</span><span>
|
||||
</span><a name="line-22"></a><span class="hs-pragma">{-# LANGUAGE DeriveTraversable #-}</span><span>
|
||||
</span><a name="line-23"></a><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}</span><span>
|
||||
</span><a name="line-24"></a><span>
|
||||
</span><a name="line-25"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-26"></a><span>
|
||||
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Model.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span></a><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.API.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">API</span></a><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.MimeTypes.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span></a><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Logging.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span></a><span>
|
||||
</span><a name="line-31"></a><span>
|
||||
</span><a name="line-32"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">IO</span><span class="hs-operator">.</span><span class="hs-identifier">Class</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-33"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Aeson</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
|
||||
</span><a name="line-34"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Aeson</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
|
||||
</span><a name="line-35"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Proxy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Proxy</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-36"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Function</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var">&</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-37"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Monoid</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var"><></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-38"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Text</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-39"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC</span><span class="hs-operator">.</span><span class="hs-identifier">Exts</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">IsString</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-40"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">FormUrlEncoded</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-41"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">HttpApiData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-42"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">Catch</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">MonadThrow</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-43"></a><span>
|
||||
</span><a name="line-44"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Time</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">TI</span><span>
|
||||
</span><a name="line-45"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Map</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">Map</span><span>
|
||||
</span><a name="line-46"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-47"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span class="hs-operator">.</span><span class="hs-identifier">Encoding</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-48"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Text</span><span class="hs-operator">.</span><span class="hs-identifier">Printf</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-49"></a><span>
|
||||
</span><a name="line-50"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">B</span><span>
|
||||
</span><a name="line-51"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BL</span><span>
|
||||
</span><a name="line-52"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BC</span><span>
|
||||
</span><a name="line-53"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BCL</span><span>
|
||||
</span><a name="line-54"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Builder</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BB</span><span>
|
||||
</span><a name="line-55"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-56"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span class="hs-operator">.</span><span class="hs-identifier">TLS</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-57"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span class="hs-operator">.</span><span class="hs-identifier">MultipartFormData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-58"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span class="hs-operator">.</span><span class="hs-identifier">Method</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-59"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-60"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span class="hs-operator">.</span><span class="hs-identifier">URI</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-61"></a><span>
|
||||
</span><a name="line-62"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Exception</span><span class="hs-operator">.</span><span class="hs-identifier">Safe</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">E</span><span>
|
||||
</span><a name="line-63"></a><span class="hs-comment">-- * Config</span><span>
|
||||
</span><a name="line-64"></a><span>
|
||||
</span><a name="line-65"></a><span class="hs-comment">-- | </span><span>
|
||||
</span><a name="line-66"></a><span class="hs-keyword">data</span><span> </span><a name="SwaggerPetstoreConfig"><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier">SwaggerPetstoreConfig</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="SwaggerPetstoreConfig"><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier">SwaggerPetstoreConfig</span></a></a><span>
|
||||
</span><a name="line-67"></a><span> </span><span class="hs-special">{</span><span> </span><a name="configHost"><a href="SwaggerPetstore.Client.html#configHost"><span class="hs-identifier">configHost</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-comment">-- ^ host supplied in the Request</span><span>
|
||||
</span><a name="line-68"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configUserAgent"><a href="SwaggerPetstore.Client.html#configUserAgent"><span class="hs-identifier">configUserAgent</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-comment">-- ^ user-agent supplied in the Request</span><span>
|
||||
</span><a name="line-69"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configLogExecWithContext"><a href="SwaggerPetstore.Client.html#configLogExecWithContext"><span class="hs-identifier">configLogExecWithContext</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span> </span><span class="hs-comment">-- ^ Run a block using a Logger instance</span><span>
|
||||
</span><a name="line-70"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configLogContext"><a href="SwaggerPetstore.Client.html#configLogContext"><span class="hs-identifier">configLogContext</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-comment">-- ^ Configures the logger</span><span>
|
||||
</span><a name="line-71"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configAuthMethods"><a href="SwaggerPetstore.Client.html#configAuthMethods"><span class="hs-identifier">configAuthMethods</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><a href="SwaggerPetstore.API.html#AnyAuthMethod"><span class="hs-identifier hs-type">AnyAuthMethod</span></a><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ List of configured auth methods</span><span>
|
||||
</span><a name="line-72"></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-73"></a><span>
|
||||
</span><a name="line-74"></a><span class="hs-comment">-- | display the config</span><span>
|
||||
</span><a name="line-75"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">Show</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-76"></a><span> </span><a name="local-8214565720323792830"><span class="hs-identifier">show</span></a><span> </span><a name="local-6989586621679161225"><a href="#local-6989586621679161225"><span class="hs-identifier">c</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-77"></a><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">printf</span><span>
|
||||
</span><a name="line-78"></a><span> </span><span class="hs-string">"{ configHost = %v, configUserAgent = %v, ..}"</span><span>
|
||||
</span><a name="line-79"></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configHost</span><span> </span><a href="#local-6989586621679161225"><span class="hs-identifier hs-var">c</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-80"></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configUserAgent</span><span> </span><a href="#local-6989586621679161225"><span class="hs-identifier hs-var">c</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-81"></a><span>
|
||||
</span><a name="line-82"></a><span class="hs-comment">-- | constructs a default SwaggerPetstoreConfig</span><span>
|
||||
</span><a name="line-83"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-84"></a><span class="hs-comment">-- configHost:</span><span>
|
||||
</span><a name="line-85"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-86"></a><span class="hs-comment">-- @http://petstore.swagger.io:80/v2@</span><span>
|
||||
</span><a name="line-87"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-88"></a><span class="hs-comment">-- configUserAgent:</span><span>
|
||||
</span><a name="line-89"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-90"></a><span class="hs-comment">-- @"swagger-haskell-http-client/1.0.0"@</span><span>
|
||||
</span><a name="line-91"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-92"></a><span class="hs-identifier">newConfig</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-93"></a><a name="newConfig"><a href="SwaggerPetstore.Client.html#newConfig"><span class="hs-identifier">newConfig</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-94"></a><span> </span><a name="local-6989586621679160729"><a href="#local-6989586621679160729"><span class="hs-identifier">logCxt</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Logging.html#initLogContext"><span class="hs-identifier hs-var">initLogContext</span></a><span>
|
||||
</span><a name="line-95"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-var">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-96"></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configHost</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"http://petstore.swagger.io:80/v2"</span><span>
|
||||
</span><a name="line-97"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configUserAgent</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"swagger-haskell-http-client/1.0.0"</span><span>
|
||||
</span><a name="line-98"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a><span>
|
||||
</span><a name="line-99"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160729"><span class="hs-identifier hs-var">logCxt</span></a><span>
|
||||
</span><a name="line-100"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-101"></a><span> </span><span class="hs-special">}</span><span> </span><span>
|
||||
</span><a name="line-102"></a><span>
|
||||
</span><a name="line-103"></a><span class="hs-comment">-- | updates config use AuthMethod on matching requests</span><span>
|
||||
</span><a name="line-104"></a><span class="hs-identifier">addAuthMethod</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.API.html#AuthMethod"><span class="hs-identifier hs-type">AuthMethod</span></a><span> </span><a href="#local-6989586621679160728"><span class="hs-identifier hs-type">auth</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160728"><span class="hs-identifier hs-type">auth</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-105"></a><a name="addAuthMethod"><a href="SwaggerPetstore.Client.html#addAuthMethod"><span class="hs-identifier">addAuthMethod</span></a></a><span> </span><a name="local-6989586621679160730"><a href="#local-6989586621679160730"><span class="hs-identifier">config</span></a></a><span class="hs-glyph">@</span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-var">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-special">{</span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">as</span><span class="hs-special">}</span><span> </span><a name="local-6989586621679160732"><a href="#local-6989586621679160732"><span class="hs-identifier">a</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-106"></a><span> </span><a href="#local-6989586621679160730"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.API.html#AnyAuthMethod"><span class="hs-identifier hs-var">AnyAuthMethod</span></a><span> </span><a href="#local-6989586621679160732"><span class="hs-identifier hs-var">a</span></a><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-keyword">as</span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-107"></a><span>
|
||||
</span><a name="line-108"></a><span class="hs-comment">-- | updates the config to use stdout logging</span><span>
|
||||
</span><a name="line-109"></a><span class="hs-identifier">withStdoutLogging</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-110"></a><a name="withStdoutLogging"><a href="SwaggerPetstore.Client.html#withStdoutLogging"><span class="hs-identifier">withStdoutLogging</span></a></a><span> </span><a name="local-6989586621679160733"><a href="#local-6989586621679160733"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-111"></a><span> </span><a name="local-6989586621679160734"><a href="#local-6989586621679160734"><span class="hs-identifier">logCxt</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Logging.html#stdoutLoggingContext"><span class="hs-identifier hs-var">stdoutLoggingContext</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679160733"><span class="hs-identifier hs-var">p</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-112"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="#local-6989586621679160733"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#stdoutLoggingExec"><span class="hs-identifier hs-var">stdoutLoggingExec</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160734"><span class="hs-identifier hs-var">logCxt</span></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-113"></a><span>
|
||||
</span><a name="line-114"></a><span class="hs-comment">-- | updates the config to use stderr logging</span><span>
|
||||
</span><a name="line-115"></a><span class="hs-identifier">withStderrLogging</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-116"></a><a name="withStderrLogging"><a href="SwaggerPetstore.Client.html#withStderrLogging"><span class="hs-identifier">withStderrLogging</span></a></a><span> </span><a name="local-6989586621679160735"><a href="#local-6989586621679160735"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-117"></a><span> </span><a name="local-6989586621679160736"><a href="#local-6989586621679160736"><span class="hs-identifier">logCxt</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Logging.html#stderrLoggingContext"><span class="hs-identifier hs-var">stderrLoggingContext</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679160735"><span class="hs-identifier hs-var">p</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-118"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="#local-6989586621679160735"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#stderrLoggingExec"><span class="hs-identifier hs-var">stderrLoggingExec</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160736"><span class="hs-identifier hs-var">logCxt</span></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-119"></a><span>
|
||||
</span><a name="line-120"></a><span class="hs-comment">-- | updates the config to disable logging</span><span>
|
||||
</span><a name="line-121"></a><span class="hs-identifier">withNoLogging</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-122"></a><a name="withNoLogging"><a href="SwaggerPetstore.Client.html#withNoLogging"><span class="hs-identifier">withNoLogging</span></a></a><span> </span><a name="local-6989586621679160737"><a href="#local-6989586621679160737"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160737"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runNullLogExec"><span class="hs-identifier hs-var">runNullLogExec</span></a><span class="hs-special">}</span><span>
|
||||
</span><a name="line-123"></a><span>
|
||||
</span><a name="line-124"></a><span class="hs-comment">-- * Dispatch</span><span>
|
||||
</span><a name="line-125"></a><span>
|
||||
</span><a name="line-126"></a><span class="hs-comment">-- ** Lbs</span><span>
|
||||
</span><a name="line-127"></a><span>
|
||||
</span><a name="line-128"></a><span class="hs-comment">-- | send a request returning the raw http response</span><span>
|
||||
</span><a name="line-129"></a><span class="hs-identifier">dispatchLbs</span><span>
|
||||
</span><a name="line-130"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679160724"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160725"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160726"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-131"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-132"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-133"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160724"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160726"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160727"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-134"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160725"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-135"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-136"></a><a name="dispatchLbs"><a href="SwaggerPetstore.Client.html#dispatchLbs"><span class="hs-identifier">dispatchLbs</span></a></a><span> </span><a name="local-6989586621679160738"><a href="#local-6989586621679160738"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160739"><a href="#local-6989586621679160739"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160740"><a href="#local-6989586621679160740"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160741"><a href="#local-6989586621679160741"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-137"></a><span> </span><a name="local-6989586621679160742"><a href="#local-6989586621679160742"><span class="hs-identifier">initReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#_toInitRequest"><span class="hs-identifier hs-var">_toInitRequest</span></a><span> </span><a href="#local-6989586621679160739"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160740"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160741"><span class="hs-identifier hs-var">accept</span></a><span> </span><span>
|
||||
</span><a name="line-138"></a><span> </span><a href="SwaggerPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier hs-var">dispatchInitUnsafe</span></a><span> </span><a href="#local-6989586621679160738"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160739"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160742"><span class="hs-identifier hs-var">initReq</span></a><span>
|
||||
</span><a name="line-139"></a><span>
|
||||
</span><a name="line-140"></a><span class="hs-comment">-- ** Mime</span><span>
|
||||
</span><a name="line-141"></a><span>
|
||||
</span><a name="line-142"></a><span class="hs-comment">-- | pair of decoded http body and http response</span><span>
|
||||
</span><a name="line-143"></a><span class="hs-keyword">data</span><span> </span><a name="MimeResult"><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier">MimeResult</span></a></a><span> </span><a name="local-6989586621679160689"><a href="#local-6989586621679160689"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-144"></a><span> </span><a name="MimeResult"><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier">MimeResult</span></a></a><span> </span><span class="hs-special">{</span><span> </span><a name="mimeResult"><a href="SwaggerPetstore.Client.html#mimeResult"><span class="hs-identifier">mimeResult</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Either</span><span> </span><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier hs-type">MimeError</span></a><span> </span><a href="#local-6989586621679160689"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ decoded http body</span><span>
|
||||
</span><a name="line-145"></a><span> </span><span class="hs-special">,</span><span> </span><a name="mimeResultResponse"><a href="SwaggerPetstore.Client.html#mimeResultResponse"><span class="hs-identifier">mimeResultResponse</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-comment">-- ^ http response </span><span>
|
||||
</span><a name="line-146"></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-147"></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Functor</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Foldable</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Traversable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-148"></a><span>
|
||||
</span><a name="line-149"></a><span class="hs-comment">-- | pair of unrender/parser error and http response</span><span>
|
||||
</span><a name="line-150"></a><span class="hs-keyword">data</span><span> </span><a name="MimeError"><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier">MimeError</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-151"></a><span> </span><a name="MimeError"><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier">MimeError</span></a></a><span> </span><span class="hs-special">{</span><span>
|
||||
</span><a name="line-152"></a><span> </span><a name="mimeError"><a href="SwaggerPetstore.Client.html#mimeError"><span class="hs-identifier">mimeError</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-comment">-- ^ unrender/parser error</span><span>
|
||||
</span><a name="line-153"></a><span> </span><span class="hs-special">,</span><span> </span><a name="mimeErrorResponse"><a href="SwaggerPetstore.Client.html#mimeErrorResponse"><span class="hs-identifier">mimeErrorResponse</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-comment">-- ^ http response </span><span>
|
||||
</span><a name="line-154"></a><span> </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Eq</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Show</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-155"></a><span>
|
||||
</span><a name="line-156"></a><span class="hs-comment">-- | send a request returning the 'MimeResult'</span><span>
|
||||
</span><a name="line-157"></a><span class="hs-identifier">dispatchMime</span><span>
|
||||
</span><a name="line-158"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679160720"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160721"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="#local-6989586621679160721"><span class="hs-identifier hs-type">accept</span></a><span> </span><a href="#local-6989586621679160722"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160723"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-159"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-160"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-161"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160720"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160723"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160722"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-162"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160721"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-163"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier hs-type">MimeResult</span></a><span> </span><a href="#local-6989586621679160722"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-164"></a><a name="dispatchMime"><a href="SwaggerPetstore.Client.html#dispatchMime"><span class="hs-identifier">dispatchMime</span></a></a><span> </span><a name="local-6989586621679160743"><a href="#local-6989586621679160743"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160744"><a href="#local-6989586621679160744"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160745"><a href="#local-6989586621679160745"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160746"><a href="#local-6989586621679160746"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-165"></a><span> </span><a name="local-6989586621679160747"><a href="#local-6989586621679160747"><span class="hs-identifier">httpResponse</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#dispatchLbs"><span class="hs-identifier hs-var">dispatchLbs</span></a><span> </span><a href="#local-6989586621679160743"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160744"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160745"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160746"><span class="hs-identifier hs-var">accept</span></a><span>
|
||||
</span><a name="line-166"></a><span> </span><a name="local-6989586621679160750"><a href="#local-6989586621679160750"><span class="hs-identifier">parsedResult</span></a></a><span> </span><span class="hs-glyph"><-</span><span>
|
||||
</span><a name="line-167"></a><span> </span><a href="SwaggerPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><span class="hs-string">"Client"</span><span> </span><a href="#local-6989586621679160744"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-168"></a><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">case</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender%27"><span class="hs-identifier hs-var">mimeUnrender'</span></a><span> </span><a href="#local-6989586621679160746"><span class="hs-identifier hs-var">accept</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">responseBody</span><span> </span><a href="#local-6989586621679160747"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-169"></a><span> </span><span class="hs-identifier hs-var">Left</span><span> </span><a name="local-6989586621679160748"><a href="#local-6989586621679160748"><span class="hs-identifier">s</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-170"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><span class="hs-string">"Client"</span><span> </span><a href="SwaggerPetstore.Logging.html#levelError"><span class="hs-identifier hs-var">levelError</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><a href="#local-6989586621679160748"><span class="hs-identifier hs-var">s</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-171"></a><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Left</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier hs-var">MimeError</span></a><span> </span><a href="#local-6989586621679160748"><span class="hs-identifier hs-var">s</span></a><span> </span><a href="#local-6989586621679160747"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-172"></a><span> </span><span class="hs-identifier hs-var">Right</span><span> </span><a name="local-6989586621679160749"><a href="#local-6989586621679160749"><span class="hs-identifier">r</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Right</span><span> </span><a href="#local-6989586621679160749"><span class="hs-identifier hs-var">r</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-173"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier hs-var">MimeResult</span></a><span> </span><a href="#local-6989586621679160750"><span class="hs-identifier hs-var">parsedResult</span></a><span> </span><a href="#local-6989586621679160747"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-174"></a><span>
|
||||
</span><a name="line-175"></a><span class="hs-comment">-- | like 'dispatchMime', but only returns the decoded http body</span><span>
|
||||
</span><a name="line-176"></a><span class="hs-identifier">dispatchMime'</span><span>
|
||||
</span><a name="line-177"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679160716"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160717"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="#local-6989586621679160717"><span class="hs-identifier hs-type">accept</span></a><span> </span><a href="#local-6989586621679160718"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160719"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-178"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-179"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-180"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160716"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160719"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160718"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-181"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160717"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-182"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Either</span><span> </span><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier hs-type">MimeError</span></a><span> </span><a href="#local-6989586621679160718"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-183"></a><a name="dispatchMime%27"><a href="SwaggerPetstore.Client.html#dispatchMime%27"><span class="hs-identifier">dispatchMime'</span></a></a><span> </span><a name="local-6989586621679160751"><a href="#local-6989586621679160751"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160752"><a href="#local-6989586621679160752"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160753"><a href="#local-6989586621679160753"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160754"><a href="#local-6989586621679160754"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-184"></a><span> </span><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier hs-var">MimeResult</span></a><span> </span><a name="local-6989586621679160755"><a href="#local-6989586621679160755"><span class="hs-identifier">parsedResult</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#dispatchMime"><span class="hs-identifier hs-var">dispatchMime</span></a><span> </span><a href="#local-6989586621679160751"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160752"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160753"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160754"><span class="hs-identifier hs-var">accept</span></a><span> </span><span>
|
||||
</span><a name="line-185"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><a href="#local-6989586621679160755"><span class="hs-identifier hs-var">parsedResult</span></a><span>
|
||||
</span><a name="line-186"></a><span>
|
||||
</span><a name="line-187"></a><span class="hs-comment">-- ** Unsafe</span><span>
|
||||
</span><a name="line-188"></a><span>
|
||||
</span><a name="line-189"></a><span class="hs-comment">-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented)</span><span>
|
||||
</span><a name="line-190"></a><span class="hs-identifier">dispatchLbsUnsafe</span><span>
|
||||
</span><a name="line-191"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160712"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160713"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-192"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-193"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-194"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160714"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160713"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160715"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-195"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160712"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-196"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-197"></a><a name="dispatchLbsUnsafe"><a href="SwaggerPetstore.Client.html#dispatchLbsUnsafe"><span class="hs-identifier">dispatchLbsUnsafe</span></a></a><span> </span><a name="local-6989586621679160756"><a href="#local-6989586621679160756"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160757"><a href="#local-6989586621679160757"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160758"><a href="#local-6989586621679160758"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160759"><a href="#local-6989586621679160759"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-198"></a><span> </span><a name="local-6989586621679160760"><a href="#local-6989586621679160760"><span class="hs-identifier">initReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#_toInitRequest"><span class="hs-identifier hs-var">_toInitRequest</span></a><span> </span><a href="#local-6989586621679160757"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160758"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160759"><span class="hs-identifier hs-var">accept</span></a><span>
|
||||
</span><a name="line-199"></a><span> </span><a href="SwaggerPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier hs-var">dispatchInitUnsafe</span></a><span> </span><a href="#local-6989586621679160756"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160757"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160760"><span class="hs-identifier hs-var">initReq</span></a><span>
|
||||
</span><a name="line-200"></a><span>
|
||||
</span><a name="line-201"></a><span class="hs-comment">-- | dispatch an InitRequest</span><span>
|
||||
</span><a name="line-202"></a><span class="hs-identifier">dispatchInitUnsafe</span><span>
|
||||
</span><a name="line-203"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-204"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-205"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160708"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160709"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160710"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160711"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ init request</span><span>
|
||||
</span><a name="line-206"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-207"></a><a name="dispatchInitUnsafe"><a href="SwaggerPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier">dispatchInitUnsafe</span></a></a><span> </span><a name="local-6989586621679160761"><a href="#local-6989586621679160761"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160762"><a href="#local-6989586621679160762"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679160763"><a href="#local-6989586621679160763"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-208"></a><span> </span><a href="SwaggerPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><a href="#local-6989586621679160764"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="#local-6989586621679160762"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-209"></a><span> </span><span class="hs-keyword">do</span><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160764"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelInfo"><span class="hs-identifier hs-var">levelInfo</span></a><span> </span><a href="#local-6989586621679160766"><span class="hs-identifier hs-var">requestLogMsg</span></a><span>
|
||||
</span><a name="line-210"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160764"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelDebug"><span class="hs-identifier hs-var">levelDebug</span></a><span> </span><a href="#local-6989586621679160767"><span class="hs-identifier hs-var">requestDbgLogMsg</span></a><span>
|
||||
</span><a name="line-211"></a><span> </span><a name="local-6989586621679161199"><a href="#local-6989586621679161199"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">liftIO</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">httpLbs</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">manager</span></a><span>
|
||||
</span><a name="line-212"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160764"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelInfo"><span class="hs-identifier hs-var">levelInfo</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679160769"><span class="hs-identifier hs-var">responseLogMsg</span></a><span> </span><a href="#local-6989586621679161199"><span class="hs-identifier hs-var">res</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-213"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160764"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelDebug"><span class="hs-identifier hs-var">levelDebug</span></a><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679161199"><span class="hs-identifier hs-var">res</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-214"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><a href="#local-6989586621679161199"><span class="hs-identifier hs-var">res</span></a><span>
|
||||
</span><a name="line-215"></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-216"></a><span> </span><a name="local-6989586621679160764"><a href="#local-6989586621679160764"><span class="hs-identifier">src</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"Client"</span><span>
|
||||
</span><a name="line-217"></a><span> </span><a name="local-6989586621679160765"><a href="#local-6989586621679160765"><span class="hs-identifier">endpoint</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-218"></a><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-219"></a><span> </span><span class="hs-identifier hs-var">BC</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-220"></a><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">method</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">" "</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">host</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">path</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">queryString</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span>
|
||||
</span><a name="line-221"></a><span> </span><a name="local-6989586621679160766"><a href="#local-6989586621679160766"><span class="hs-identifier">requestLogMsg</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"REQ:"</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><a href="#local-6989586621679160765"><span class="hs-identifier hs-var">endpoint</span></a><span>
|
||||
</span><a name="line-222"></a><span> </span><a name="local-6989586621679160767"><a href="#local-6989586621679160767"><span class="hs-identifier">requestDbgLogMsg</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-223"></a><span> </span><span class="hs-string">"Headers="</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestHeaders</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">" Body="</span><span> </span><span class="hs-operator hs-var"><></span><span>
|
||||
</span><a name="line-224"></a><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-225"></a><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyLBS</span><span> </span><a name="local-6989586621679160770"><a href="#local-6989586621679160770"><span class="hs-identifier">xs</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">decodeUtf8</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toStrict</span><span> </span><a href="#local-6989586621679160770"><span class="hs-identifier hs-var">xs</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-226"></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-string">"<RequestBody>"</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-227"></a><span> </span><a name="local-6989586621679160768"><a href="#local-6989586621679160768"><span class="hs-identifier">responseStatusCode</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">statusCode</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">responseStatus</span><span>
|
||||
</span><a name="line-228"></a><span> </span><a name="local-6989586621679160769"><a href="#local-6989586621679160769"><span class="hs-identifier">responseLogMsg</span></a></a><span> </span><a name="local-6989586621679161145"><a href="#local-6989586621679161145"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-229"></a><span> </span><span class="hs-string">"RES:statusCode="</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><a href="#local-6989586621679160768"><span class="hs-identifier hs-var">responseStatusCode</span></a><span> </span><a href="#local-6989586621679161145"><span class="hs-identifier hs-var">res</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">" ("</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><a href="#local-6989586621679160765"><span class="hs-identifier hs-var">endpoint</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">")"</span><span>
|
||||
</span><a name="line-230"></a><span>
|
||||
</span><a name="line-231"></a><span class="hs-comment">-- * InitRequest</span><span>
|
||||
</span><a name="line-232"></a><span>
|
||||
</span><a name="line-233"></a><span class="hs-comment">-- | wraps an http-client 'Request' with request/response type parameters</span><span>
|
||||
</span><a name="line-234"></a><span class="hs-keyword">newtype</span><span> </span><a name="InitRequest"><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier">InitRequest</span></a></a><span> </span><a name="local-6989586621679160685"><a href="#local-6989586621679160685"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679160686"><a href="#local-6989586621679160686"><span class="hs-identifier">contentType</span></a></a><span> </span><a name="local-6989586621679160687"><a href="#local-6989586621679160687"><span class="hs-identifier">res</span></a></a><span> </span><a name="local-6989586621679160688"><a href="#local-6989586621679160688"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="InitRequest"><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier">InitRequest</span></a></a><span>
|
||||
</span><a name="line-235"></a><span> </span><span class="hs-special">{</span><span> </span><a name="unInitRequest"><a href="SwaggerPetstore.Client.html#unInitRequest"><span class="hs-identifier">unInitRequest</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span>
|
||||
</span><a name="line-236"></a><span> </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-237"></a><span>
|
||||
</span><a name="line-238"></a><span class="hs-comment">-- | Build an http-client 'Request' record from the supplied config and request</span><span>
|
||||
</span><a name="line-239"></a><span class="hs-identifier">_toInitRequest</span><span>
|
||||
</span><a name="line-240"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160704"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160705"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-241"></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-242"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160706"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160705"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160707"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-243"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160704"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-244"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160706"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160705"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160707"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160704"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ initialized request</span><span>
|
||||
</span><a name="line-245"></a><a name="_toInitRequest"><a href="SwaggerPetstore.Client.html#_toInitRequest"><span class="hs-identifier">_toInitRequest</span></a></a><span> </span><a name="local-6989586621679161200"><a href="#local-6989586621679161200"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679161201"><a href="#local-6989586621679161201"><span class="hs-identifier">req0</span></a></a><span> </span><a name="local-6989586621679161202"><a href="#local-6989586621679161202"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-246"></a><span> </span><a name="local-6989586621679161203"><a href="#local-6989586621679161203"><span class="hs-identifier">parsedReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">parseRequest</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">append</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configHost</span><span> </span><a href="#local-6989586621679161200"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">concat</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rUrlPath</span><span> </span><a href="#local-6989586621679161201"><span class="hs-identifier hs-var">req0</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-247"></a><span> </span><span class="hs-keyword">let</span><span> </span><a name="local-6989586621679161204"><a href="#local-6989586621679161204"><span class="hs-identifier">req1</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Client.html#_applyAuthMethods"><span class="hs-identifier hs-var">_applyAuthMethods</span></a><span> </span><a href="#local-6989586621679161201"><span class="hs-identifier hs-var">req0</span></a><span> </span><a href="#local-6989586621679161200"><span class="hs-identifier hs-var">config</span></a><span>
|
||||
</span><a name="line-248"></a><span> </span><span class="hs-operator hs-var">&</span><span> </span><a href="SwaggerPetstore.API.html#_setContentTypeHeader"><span class="hs-identifier hs-var">_setContentTypeHeader</span></a><span>
|
||||
</span><a name="line-249"></a><span> </span><span class="hs-operator hs-var">&</span><span> </span><span class="hs-identifier hs-var">flip</span><span> </span><a href="SwaggerPetstore.API.html#_setAcceptHeader"><span class="hs-identifier hs-var">_setAcceptHeader</span></a><span> </span><a href="#local-6989586621679161202"><span class="hs-identifier hs-var">accept</span></a><span>
|
||||
</span><a name="line-250"></a><span> </span><a name="local-6989586621679161205"><a href="#local-6989586621679161205"><span class="hs-identifier">reqHeaders</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-string">"User-Agent"</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toHeader</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configUserAgent</span><span> </span><a href="#local-6989586621679161200"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-identifier">paramsHeaders</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679161204"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-251"></a><span> </span><a name="local-6989586621679161206"><a href="#local-6989586621679161206"><span class="hs-identifier">reqQuery</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">renderQuery</span><span> </span><span class="hs-identifier hs-var">True</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">paramsQuery</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679161204"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-252"></a><span> </span><a name="local-6989586621679161207"><a href="#local-6989586621679161207"><span class="hs-identifier">pReq</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161203"><span class="hs-identifier hs-var">parsedReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">method</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rMethod</span><span> </span><a href="#local-6989586621679161204"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-253"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestHeaders</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161205"><span class="hs-identifier hs-var">reqHeaders</span></a><span>
|
||||
</span><a name="line-254"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">queryString</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161206"><span class="hs-identifier hs-var">reqQuery</span></a><span>
|
||||
</span><a name="line-255"></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-256"></a><span> </span><a name="local-6989586621679161212"><a href="#local-6989586621679161212"><span class="hs-identifier">outReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">paramsBody</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679161204"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-257"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyNone"><span class="hs-identifier hs-var">ParamBodyNone</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161207"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">mempty</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-258"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyB"><span class="hs-identifier hs-var">ParamBodyB</span></a><span> </span><a name="local-6989586621679161208"><a href="#local-6989586621679161208"><span class="hs-identifier">bs</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161207"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyBS</span><span> </span><a href="#local-6989586621679161208"><span class="hs-identifier hs-var">bs</span></a><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-259"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyBL"><span class="hs-identifier hs-var">ParamBodyBL</span></a><span> </span><a name="local-6989586621679161209"><a href="#local-6989586621679161209"><span class="hs-identifier">bl</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161207"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyLBS</span><span> </span><a href="#local-6989586621679161209"><span class="hs-identifier hs-var">bl</span></a><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-260"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyFormUrlEncoded"><span class="hs-identifier hs-var">ParamBodyFormUrlEncoded</span></a><span> </span><a name="local-6989586621679161210"><a href="#local-6989586621679161210"><span class="hs-identifier">form</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161207"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyLBS</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">urlEncodeForm</span><span> </span><a href="#local-6989586621679161210"><span class="hs-identifier hs-var">form</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-261"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyMultipartFormData"><span class="hs-identifier hs-var">ParamBodyMultipartFormData</span></a><span> </span><a name="local-6989586621679161211"><a href="#local-6989586621679161211"><span class="hs-identifier">parts</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">formDataBody</span><span> </span><a href="#local-6989586621679161211"><span class="hs-identifier hs-var">parts</span></a><span> </span><a href="#local-6989586621679161207"><span class="hs-identifier hs-var">pReq</span></a><span>
|
||||
</span><a name="line-262"></a><span>
|
||||
</span><a name="line-263"></a><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a href="#local-6989586621679161212"><span class="hs-identifier hs-var">outReq</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-264"></a><span>
|
||||
</span><a name="line-265"></a><span class="hs-comment">-- | apply all matching AuthMethods in config to request</span><span>
|
||||
</span><a name="line-266"></a><span class="hs-identifier">_applyAuthMethods</span><span>
|
||||
</span><a name="line-267"></a><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160701"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160702"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160703"><span class="hs-identifier hs-type">res</span></a><span>
|
||||
</span><a name="line-268"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-269"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160701"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160702"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160703"><span class="hs-identifier hs-type">res</span></a><span>
|
||||
</span><a name="line-270"></a><a name="_applyAuthMethods"><a href="SwaggerPetstore.Client.html#_applyAuthMethods"><span class="hs-identifier">_applyAuthMethods</span></a></a><span> </span><a name="local-6989586621679161213"><a href="#local-6989586621679161213"><span class="hs-identifier">req</span></a></a><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-var">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-special">{</span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">as</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-271"></a><span> </span><span class="hs-identifier hs-var">foldl</span><span> </span><a href="#local-6989586621679161215"><span class="hs-identifier hs-var">go</span></a><span> </span><a href="#local-6989586621679161213"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-keyword">as</span><span>
|
||||
</span><a name="line-272"></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-273"></a><span> </span><a name="local-6989586621679161215"><a href="#local-6989586621679161215"><span class="hs-identifier">go</span></a></a><span> </span><a name="local-6989586621679161216"><a href="#local-6989586621679161216"><span class="hs-identifier">r</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.API.html#AnyAuthMethod"><span class="hs-identifier hs-var">AnyAuthMethod</span></a><span> </span><a name="local-6989586621679161217"><a href="#local-6989586621679161217"><span class="hs-identifier">a</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161216"><span class="hs-identifier hs-var">r</span></a><span> </span><span class="hs-special">`</span><a href="SwaggerPetstore.API.html#applyAuthMethod"><span class="hs-identifier hs-var">applyAuthMethod</span></a><span class="hs-special">`</span><span> </span><a href="#local-6989586621679161217"><span class="hs-identifier hs-var">a</span></a><span>
|
||||
</span><a name="line-274"></a><span>
|
||||
</span><a name="line-275"></a><span class="hs-comment">-- | modify the underlying Request</span><span>
|
||||
</span><a name="line-276"></a><span class="hs-identifier">modifyInitRequest</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160697"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160698"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160699"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160700"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160697"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160698"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160699"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160700"><span class="hs-identifier hs-type">accept</span></a><span> </span><span>
|
||||
</span><a name="line-277"></a><a name="modifyInitRequest"><a href="SwaggerPetstore.Client.html#modifyInitRequest"><span class="hs-identifier">modifyInitRequest</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679161218"><a href="#local-6989586621679161218"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><a name="local-6989586621679161219"><a href="#local-6989586621679161219"><span class="hs-identifier">f</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161219"><span class="hs-identifier hs-var">f</span></a><span> </span><a href="#local-6989586621679161218"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-278"></a><span>
|
||||
</span><a name="line-279"></a><span class="hs-comment">-- | modify the underlying Request (monadic)</span><span>
|
||||
</span><a name="line-280"></a><span class="hs-identifier">modifyInitRequestM</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Monad</span><span> </span><a href="#local-6989586621679160692"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160693"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160694"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160695"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160696"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160692"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160692"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160693"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160694"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160695"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160696"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-281"></a><a name="modifyInitRequestM"><a href="SwaggerPetstore.Client.html#modifyInitRequestM"><span class="hs-identifier">modifyInitRequestM</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679161220"><a href="#local-6989586621679161220"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><a name="local-6989586621679161221"><a href="#local-6989586621679161221"><span class="hs-identifier">f</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">fmap</span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161221"><span class="hs-identifier hs-var">f</span></a><span> </span><a href="#local-6989586621679161220"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-282"></a><span>
|
||||
</span><a name="line-283"></a><span class="hs-comment">-- ** Logging </span><span>
|
||||
</span><a name="line-284"></a><span>
|
||||
</span><a name="line-285"></a><span class="hs-comment">-- | Run a block using the configured logger instance</span><span>
|
||||
</span><a name="line-286"></a><span class="hs-identifier">runConfigLog</span><span>
|
||||
</span><a name="line-287"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadIO</span><span> </span><a href="#local-6989586621679160691"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-288"></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679160691"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-289"></a><a name="runConfigLog"><a href="SwaggerPetstore.Client.html#runConfigLog"><span class="hs-identifier">runConfigLog</span></a></a><span> </span><a name="local-6989586621679161222"><a href="#local-6989586621679161222"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><a href="#local-6989586621679161222"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679161222"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-290"></a><span>
|
||||
</span><a name="line-291"></a><span class="hs-comment">-- | Run a block using the configured logger instance (logs exceptions)</span><span>
|
||||
</span><a name="line-292"></a><span class="hs-identifier">runConfigLogWithExceptions</span><span>
|
||||
</span><a name="line-293"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">E</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadCatch</span><span> </span><a href="#local-6989586621679160690"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadIO</span><span> </span><a href="#local-6989586621679160690"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-294"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679160690"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-295"></a><a name="runConfigLogWithExceptions"><a href="SwaggerPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier">runConfigLogWithExceptions</span></a></a><span> </span><a name="local-6989586621679161223"><a href="#local-6989586621679161223"><span class="hs-identifier">src</span></a></a><span> </span><a name="local-6989586621679161224"><a href="#local-6989586621679161224"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Client.html#runConfigLog"><span class="hs-identifier hs-var">runConfigLog</span></a><span> </span><a href="#local-6989586621679161224"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">.</span><span> </span><a href="SwaggerPetstore.Logging.html#logExceptions"><span class="hs-identifier hs-var">logExceptions</span></a><span> </span><a href="#local-6989586621679161223"><span class="hs-identifier hs-var">src</span></a><span>
|
||||
</span><a name="line-296"></a></pre></body></html>
|
||||
</span><a name="line-15"></a><span>
|
||||
</span><a name="line-16"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
|
||||
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE RecordWildCards #-}</span><span>
|
||||
</span><a name="line-19"></a><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
|
||||
</span><a name="line-20"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
||||
</span><a name="line-21"></a><span class="hs-pragma">{-# LANGUAGE DeriveFunctor #-}</span><span>
|
||||
</span><a name="line-22"></a><span class="hs-pragma">{-# LANGUAGE DeriveFoldable #-}</span><span>
|
||||
</span><a name="line-23"></a><span class="hs-pragma">{-# LANGUAGE DeriveTraversable #-}</span><span>
|
||||
</span><a name="line-24"></a><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}</span><span>
|
||||
</span><a name="line-25"></a><span>
|
||||
</span><a name="line-26"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-27"></a><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Model.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span></a><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.API.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">API</span></a><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.MimeTypes.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span></a><span>
|
||||
</span><a name="line-31"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Logging.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span></a><span>
|
||||
</span><a name="line-32"></a><span>
|
||||
</span><a name="line-33"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">IO</span><span class="hs-operator">.</span><span class="hs-identifier">Class</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-34"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Aeson</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
|
||||
</span><a name="line-35"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Aeson</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
|
||||
</span><a name="line-36"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Proxy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Proxy</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-37"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Function</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var">&</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-38"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Monoid</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var"><></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-39"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Text</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-40"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC</span><span class="hs-operator">.</span><span class="hs-identifier">Exts</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">IsString</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-41"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">FormUrlEncoded</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-42"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">HttpApiData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-43"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">Catch</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">MonadThrow</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-44"></a><span>
|
||||
</span><a name="line-45"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Time</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">TI</span><span>
|
||||
</span><a name="line-46"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Map</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">Map</span><span>
|
||||
</span><a name="line-47"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-48"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span class="hs-operator">.</span><span class="hs-identifier">Encoding</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-49"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Text</span><span class="hs-operator">.</span><span class="hs-identifier">Printf</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-50"></a><span>
|
||||
</span><a name="line-51"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">B</span><span>
|
||||
</span><a name="line-52"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BL</span><span>
|
||||
</span><a name="line-53"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BC</span><span>
|
||||
</span><a name="line-54"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BCL</span><span>
|
||||
</span><a name="line-55"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Builder</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BB</span><span>
|
||||
</span><a name="line-56"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-57"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span class="hs-operator">.</span><span class="hs-identifier">TLS</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-58"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span class="hs-operator">.</span><span class="hs-identifier">MultipartFormData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-59"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span class="hs-operator">.</span><span class="hs-identifier">Method</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-60"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-61"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Types</span><span class="hs-operator">.</span><span class="hs-identifier">URI</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">NH</span><span>
|
||||
</span><a name="line-62"></a><span>
|
||||
</span><a name="line-63"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Exception</span><span class="hs-operator">.</span><span class="hs-identifier">Safe</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">E</span><span>
|
||||
</span><a name="line-64"></a><span class="hs-comment">-- * Config</span><span>
|
||||
</span><a name="line-65"></a><span>
|
||||
</span><a name="line-66"></a><span class="hs-comment">-- | </span><span>
|
||||
</span><a name="line-67"></a><span class="hs-keyword">data</span><span> </span><a name="SwaggerPetstoreConfig"><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier">SwaggerPetstoreConfig</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="SwaggerPetstoreConfig"><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier">SwaggerPetstoreConfig</span></a></a><span>
|
||||
</span><a name="line-68"></a><span> </span><span class="hs-special">{</span><span> </span><a name="configHost"><a href="SwaggerPetstore.Client.html#configHost"><span class="hs-identifier">configHost</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-comment">-- ^ host supplied in the Request</span><span>
|
||||
</span><a name="line-69"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configUserAgent"><a href="SwaggerPetstore.Client.html#configUserAgent"><span class="hs-identifier">configUserAgent</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-comment">-- ^ user-agent supplied in the Request</span><span>
|
||||
</span><a name="line-70"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configLogExecWithContext"><a href="SwaggerPetstore.Client.html#configLogExecWithContext"><span class="hs-identifier">configLogExecWithContext</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span> </span><span class="hs-comment">-- ^ Run a block using a Logger instance</span><span>
|
||||
</span><a name="line-71"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configLogContext"><a href="SwaggerPetstore.Client.html#configLogContext"><span class="hs-identifier">configLogContext</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-comment">-- ^ Configures the logger</span><span>
|
||||
</span><a name="line-72"></a><span> </span><span class="hs-special">,</span><span> </span><a name="configAuthMethods"><a href="SwaggerPetstore.Client.html#configAuthMethods"><span class="hs-identifier">configAuthMethods</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><a href="SwaggerPetstore.API.html#AnyAuthMethod"><span class="hs-identifier hs-type">AnyAuthMethod</span></a><span class="hs-special">]</span><span> </span><span class="hs-comment">-- ^ List of configured auth methods</span><span>
|
||||
</span><a name="line-73"></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-74"></a><span>
|
||||
</span><a name="line-75"></a><span class="hs-comment">-- | display the config</span><span>
|
||||
</span><a name="line-76"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">Show</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-77"></a><span> </span><a name="local-8214565720323792830"><span class="hs-identifier">show</span></a><span> </span><a name="local-6989586621679161223"><a href="#local-6989586621679161223"><span class="hs-identifier">c</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-78"></a><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">printf</span><span>
|
||||
</span><a name="line-79"></a><span> </span><span class="hs-string">"{ configHost = %v, configUserAgent = %v, ..}"</span><span>
|
||||
</span><a name="line-80"></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configHost</span><span> </span><a href="#local-6989586621679161223"><span class="hs-identifier hs-var">c</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-81"></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configUserAgent</span><span> </span><a href="#local-6989586621679161223"><span class="hs-identifier hs-var">c</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-82"></a><span>
|
||||
</span><a name="line-83"></a><span class="hs-comment">-- | constructs a default SwaggerPetstoreConfig</span><span>
|
||||
</span><a name="line-84"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-85"></a><span class="hs-comment">-- configHost:</span><span>
|
||||
</span><a name="line-86"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-87"></a><span class="hs-comment">-- @http://petstore.swagger.io:80/v2@</span><span>
|
||||
</span><a name="line-88"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-89"></a><span class="hs-comment">-- configUserAgent:</span><span>
|
||||
</span><a name="line-90"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-91"></a><span class="hs-comment">-- @"swagger-haskell-http-client/1.0.0"@</span><span>
|
||||
</span><a name="line-92"></a><span class="hs-comment">--</span><span>
|
||||
</span><a name="line-93"></a><span class="hs-identifier">newConfig</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-94"></a><a name="newConfig"><a href="SwaggerPetstore.Client.html#newConfig"><span class="hs-identifier">newConfig</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-95"></a><span> </span><a name="local-6989586621679160727"><a href="#local-6989586621679160727"><span class="hs-identifier">logCxt</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Logging.html#initLogContext"><span class="hs-identifier hs-var">initLogContext</span></a><span>
|
||||
</span><a name="line-96"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-var">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-97"></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configHost</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"http://petstore.swagger.io:80/v2"</span><span>
|
||||
</span><a name="line-98"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configUserAgent</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"swagger-haskell-http-client/1.0.0"</span><span>
|
||||
</span><a name="line-99"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a><span>
|
||||
</span><a name="line-100"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160727"><span class="hs-identifier hs-var">logCxt</span></a><span>
|
||||
</span><a name="line-101"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-102"></a><span> </span><span class="hs-special">}</span><span> </span><span>
|
||||
</span><a name="line-103"></a><span>
|
||||
</span><a name="line-104"></a><span class="hs-comment">-- | updates config use AuthMethod on matching requests</span><span>
|
||||
</span><a name="line-105"></a><span class="hs-identifier">addAuthMethod</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.API.html#AuthMethod"><span class="hs-identifier hs-type">AuthMethod</span></a><span> </span><a href="#local-6989586621679160726"><span class="hs-identifier hs-type">auth</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160726"><span class="hs-identifier hs-type">auth</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-106"></a><a name="addAuthMethod"><a href="SwaggerPetstore.Client.html#addAuthMethod"><span class="hs-identifier">addAuthMethod</span></a></a><span> </span><a name="local-6989586621679160728"><a href="#local-6989586621679160728"><span class="hs-identifier">config</span></a></a><span class="hs-glyph">@</span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-var">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-special">{</span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">as</span><span class="hs-special">}</span><span> </span><a name="local-6989586621679160730"><a href="#local-6989586621679160730"><span class="hs-identifier">a</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-107"></a><span> </span><a href="#local-6989586621679160728"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.API.html#AnyAuthMethod"><span class="hs-identifier hs-var">AnyAuthMethod</span></a><span> </span><a href="#local-6989586621679160730"><span class="hs-identifier hs-var">a</span></a><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-keyword">as</span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-108"></a><span>
|
||||
</span><a name="line-109"></a><span class="hs-comment">-- | updates the config to use stdout logging</span><span>
|
||||
</span><a name="line-110"></a><span class="hs-identifier">withStdoutLogging</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-111"></a><a name="withStdoutLogging"><a href="SwaggerPetstore.Client.html#withStdoutLogging"><span class="hs-identifier">withStdoutLogging</span></a></a><span> </span><a name="local-6989586621679160731"><a href="#local-6989586621679160731"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-112"></a><span> </span><a name="local-6989586621679160732"><a href="#local-6989586621679160732"><span class="hs-identifier">logCxt</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Logging.html#stdoutLoggingContext"><span class="hs-identifier hs-var">stdoutLoggingContext</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679160731"><span class="hs-identifier hs-var">p</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-113"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="#local-6989586621679160731"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#stdoutLoggingExec"><span class="hs-identifier hs-var">stdoutLoggingExec</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160732"><span class="hs-identifier hs-var">logCxt</span></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-114"></a><span>
|
||||
</span><a name="line-115"></a><span class="hs-comment">-- | updates the config to use stderr logging</span><span>
|
||||
</span><a name="line-116"></a><span class="hs-identifier">withStderrLogging</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-117"></a><a name="withStderrLogging"><a href="SwaggerPetstore.Client.html#withStderrLogging"><span class="hs-identifier">withStderrLogging</span></a></a><span> </span><a name="local-6989586621679160733"><a href="#local-6989586621679160733"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-118"></a><span> </span><a name="local-6989586621679160734"><a href="#local-6989586621679160734"><span class="hs-identifier">logCxt</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Logging.html#stderrLoggingContext"><span class="hs-identifier hs-var">stderrLoggingContext</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679160733"><span class="hs-identifier hs-var">p</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-119"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><a href="#local-6989586621679160733"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#stderrLoggingExec"><span class="hs-identifier hs-var">stderrLoggingExec</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier">configLogContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160734"><span class="hs-identifier hs-var">logCxt</span></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-120"></a><span>
|
||||
</span><a name="line-121"></a><span class="hs-comment">-- | updates the config to disable logging</span><span>
|
||||
</span><a name="line-122"></a><span class="hs-identifier">withNoLogging</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-123"></a><a name="withNoLogging"><a href="SwaggerPetstore.Client.html#withNoLogging"><span class="hs-identifier">withNoLogging</span></a></a><span> </span><a name="local-6989586621679160735"><a href="#local-6989586621679160735"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679160735"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runNullLogExec"><span class="hs-identifier hs-var">runNullLogExec</span></a><span class="hs-special">}</span><span>
|
||||
</span><a name="line-124"></a><span>
|
||||
</span><a name="line-125"></a><span class="hs-comment">-- * Dispatch</span><span>
|
||||
</span><a name="line-126"></a><span>
|
||||
</span><a name="line-127"></a><span class="hs-comment">-- ** Lbs</span><span>
|
||||
</span><a name="line-128"></a><span>
|
||||
</span><a name="line-129"></a><span class="hs-comment">-- | send a request returning the raw http response</span><span>
|
||||
</span><a name="line-130"></a><span class="hs-identifier">dispatchLbs</span><span>
|
||||
</span><a name="line-131"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679160722"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160723"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160724"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-132"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-133"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-134"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160722"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160724"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160725"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-135"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160723"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-136"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-137"></a><a name="dispatchLbs"><a href="SwaggerPetstore.Client.html#dispatchLbs"><span class="hs-identifier">dispatchLbs</span></a></a><span> </span><a name="local-6989586621679160736"><a href="#local-6989586621679160736"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160737"><a href="#local-6989586621679160737"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160738"><a href="#local-6989586621679160738"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160739"><a href="#local-6989586621679160739"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-138"></a><span> </span><a name="local-6989586621679160740"><a href="#local-6989586621679160740"><span class="hs-identifier">initReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#_toInitRequest"><span class="hs-identifier hs-var">_toInitRequest</span></a><span> </span><a href="#local-6989586621679160737"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160738"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160739"><span class="hs-identifier hs-var">accept</span></a><span> </span><span>
|
||||
</span><a name="line-139"></a><span> </span><a href="SwaggerPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier hs-var">dispatchInitUnsafe</span></a><span> </span><a href="#local-6989586621679160736"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160737"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160740"><span class="hs-identifier hs-var">initReq</span></a><span>
|
||||
</span><a name="line-140"></a><span>
|
||||
</span><a name="line-141"></a><span class="hs-comment">-- ** Mime</span><span>
|
||||
</span><a name="line-142"></a><span>
|
||||
</span><a name="line-143"></a><span class="hs-comment">-- | pair of decoded http body and http response</span><span>
|
||||
</span><a name="line-144"></a><span class="hs-keyword">data</span><span> </span><a name="MimeResult"><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier">MimeResult</span></a></a><span> </span><a name="local-6989586621679160687"><a href="#local-6989586621679160687"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-145"></a><span> </span><a name="MimeResult"><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier">MimeResult</span></a></a><span> </span><span class="hs-special">{</span><span> </span><a name="mimeResult"><a href="SwaggerPetstore.Client.html#mimeResult"><span class="hs-identifier">mimeResult</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Either</span><span> </span><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier hs-type">MimeError</span></a><span> </span><a href="#local-6989586621679160687"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ decoded http body</span><span>
|
||||
</span><a name="line-146"></a><span> </span><span class="hs-special">,</span><span> </span><a name="mimeResultResponse"><a href="SwaggerPetstore.Client.html#mimeResultResponse"><span class="hs-identifier">mimeResultResponse</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-comment">-- ^ http response </span><span>
|
||||
</span><a name="line-147"></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-148"></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Functor</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Foldable</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Traversable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-149"></a><span>
|
||||
</span><a name="line-150"></a><span class="hs-comment">-- | pair of unrender/parser error and http response</span><span>
|
||||
</span><a name="line-151"></a><span class="hs-keyword">data</span><span> </span><a name="MimeError"><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier">MimeError</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-152"></a><span> </span><a name="MimeError"><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier">MimeError</span></a></a><span> </span><span class="hs-special">{</span><span>
|
||||
</span><a name="line-153"></a><span> </span><a name="mimeError"><a href="SwaggerPetstore.Client.html#mimeError"><span class="hs-identifier">mimeError</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-comment">-- ^ unrender/parser error</span><span>
|
||||
</span><a name="line-154"></a><span> </span><span class="hs-special">,</span><span> </span><a name="mimeErrorResponse"><a href="SwaggerPetstore.Client.html#mimeErrorResponse"><span class="hs-identifier">mimeErrorResponse</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-comment">-- ^ http response </span><span>
|
||||
</span><a name="line-155"></a><span> </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Eq</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Show</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-156"></a><span>
|
||||
</span><a name="line-157"></a><span class="hs-comment">-- | send a request returning the 'MimeResult'</span><span>
|
||||
</span><a name="line-158"></a><span class="hs-identifier">dispatchMime</span><span>
|
||||
</span><a name="line-159"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679160718"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160719"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="#local-6989586621679160719"><span class="hs-identifier hs-type">accept</span></a><span> </span><a href="#local-6989586621679160720"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160721"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-160"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-161"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-162"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160718"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160721"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160720"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-163"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160719"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-164"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier hs-type">MimeResult</span></a><span> </span><a href="#local-6989586621679160720"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-165"></a><a name="dispatchMime"><a href="SwaggerPetstore.Client.html#dispatchMime"><span class="hs-identifier">dispatchMime</span></a></a><span> </span><a name="local-6989586621679160741"><a href="#local-6989586621679160741"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160742"><a href="#local-6989586621679160742"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160743"><a href="#local-6989586621679160743"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160744"><a href="#local-6989586621679160744"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-166"></a><span> </span><a name="local-6989586621679160745"><a href="#local-6989586621679160745"><span class="hs-identifier">httpResponse</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#dispatchLbs"><span class="hs-identifier hs-var">dispatchLbs</span></a><span> </span><a href="#local-6989586621679160741"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160742"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160743"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160744"><span class="hs-identifier hs-var">accept</span></a><span>
|
||||
</span><a name="line-167"></a><span> </span><a name="local-6989586621679160748"><a href="#local-6989586621679160748"><span class="hs-identifier">parsedResult</span></a></a><span> </span><span class="hs-glyph"><-</span><span>
|
||||
</span><a name="line-168"></a><span> </span><a href="SwaggerPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><span class="hs-string">"Client"</span><span> </span><a href="#local-6989586621679160742"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-169"></a><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">case</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender%27"><span class="hs-identifier hs-var">mimeUnrender'</span></a><span> </span><a href="#local-6989586621679160744"><span class="hs-identifier hs-var">accept</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">responseBody</span><span> </span><a href="#local-6989586621679160745"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-170"></a><span> </span><span class="hs-identifier hs-var">Left</span><span> </span><a name="local-6989586621679160746"><a href="#local-6989586621679160746"><span class="hs-identifier">s</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-171"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><span class="hs-string">"Client"</span><span> </span><a href="SwaggerPetstore.Logging.html#levelError"><span class="hs-identifier hs-var">levelError</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><a href="#local-6989586621679160746"><span class="hs-identifier hs-var">s</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-172"></a><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Left</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier hs-var">MimeError</span></a><span> </span><a href="#local-6989586621679160746"><span class="hs-identifier hs-var">s</span></a><span> </span><a href="#local-6989586621679160745"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-173"></a><span> </span><span class="hs-identifier hs-var">Right</span><span> </span><a name="local-6989586621679160747"><a href="#local-6989586621679160747"><span class="hs-identifier">r</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">Right</span><span> </span><a href="#local-6989586621679160747"><span class="hs-identifier hs-var">r</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-174"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier hs-var">MimeResult</span></a><span> </span><a href="#local-6989586621679160748"><span class="hs-identifier hs-var">parsedResult</span></a><span> </span><a href="#local-6989586621679160745"><span class="hs-identifier hs-var">httpResponse</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-175"></a><span>
|
||||
</span><a name="line-176"></a><span class="hs-comment">-- | like 'dispatchMime', but only returns the decoded http body</span><span>
|
||||
</span><a name="line-177"></a><span class="hs-identifier">dispatchMime'</span><span>
|
||||
</span><a name="line-178"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier hs-type">Produces</span></a><span> </span><a href="#local-6989586621679160714"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160715"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="#local-6989586621679160715"><span class="hs-identifier hs-type">accept</span></a><span> </span><a href="#local-6989586621679160716"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160717"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-179"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-180"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-181"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160714"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160717"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160716"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-182"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160715"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-183"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Either</span><span> </span><a href="SwaggerPetstore.Client.html#MimeError"><span class="hs-identifier hs-type">MimeError</span></a><span> </span><a href="#local-6989586621679160716"><span class="hs-identifier hs-type">res</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-184"></a><a name="dispatchMime%27"><a href="SwaggerPetstore.Client.html#dispatchMime%27"><span class="hs-identifier">dispatchMime'</span></a></a><span> </span><a name="local-6989586621679160749"><a href="#local-6989586621679160749"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160750"><a href="#local-6989586621679160750"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160751"><a href="#local-6989586621679160751"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160752"><a href="#local-6989586621679160752"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-185"></a><span> </span><a href="SwaggerPetstore.Client.html#MimeResult"><span class="hs-identifier hs-var">MimeResult</span></a><span> </span><a name="local-6989586621679160753"><a href="#local-6989586621679160753"><span class="hs-identifier">parsedResult</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#dispatchMime"><span class="hs-identifier hs-var">dispatchMime</span></a><span> </span><a href="#local-6989586621679160749"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160750"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160751"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160752"><span class="hs-identifier hs-var">accept</span></a><span> </span><span>
|
||||
</span><a name="line-186"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><a href="#local-6989586621679160753"><span class="hs-identifier hs-var">parsedResult</span></a><span>
|
||||
</span><a name="line-187"></a><span>
|
||||
</span><a name="line-188"></a><span class="hs-comment">-- ** Unsafe</span><span>
|
||||
</span><a name="line-189"></a><span>
|
||||
</span><a name="line-190"></a><span class="hs-comment">-- | like 'dispatchReqLbs', but does not validate the operation is a 'Producer' of the "accept" 'MimeType'. (Useful if the server's response is undocumented)</span><span>
|
||||
</span><a name="line-191"></a><span class="hs-identifier">dispatchLbsUnsafe</span><span>
|
||||
</span><a name="line-192"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160710"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160711"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-193"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-194"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-195"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160712"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160711"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160713"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-196"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160710"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-197"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-198"></a><a name="dispatchLbsUnsafe"><a href="SwaggerPetstore.Client.html#dispatchLbsUnsafe"><span class="hs-identifier">dispatchLbsUnsafe</span></a></a><span> </span><a name="local-6989586621679160754"><a href="#local-6989586621679160754"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160755"><a href="#local-6989586621679160755"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679160756"><a href="#local-6989586621679160756"><span class="hs-identifier">request</span></a></a><span> </span><a name="local-6989586621679160757"><a href="#local-6989586621679160757"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-199"></a><span> </span><a name="local-6989586621679160758"><a href="#local-6989586621679160758"><span class="hs-identifier">initReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><a href="SwaggerPetstore.Client.html#_toInitRequest"><span class="hs-identifier hs-var">_toInitRequest</span></a><span> </span><a href="#local-6989586621679160755"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160756"><span class="hs-identifier hs-var">request</span></a><span> </span><a href="#local-6989586621679160757"><span class="hs-identifier hs-var">accept</span></a><span>
|
||||
</span><a name="line-200"></a><span> </span><a href="SwaggerPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier hs-var">dispatchInitUnsafe</span></a><span> </span><a href="#local-6989586621679160754"><span class="hs-identifier hs-var">manager</span></a><span> </span><a href="#local-6989586621679160755"><span class="hs-identifier hs-var">config</span></a><span> </span><a href="#local-6989586621679160758"><span class="hs-identifier hs-var">initReq</span></a><span>
|
||||
</span><a name="line-201"></a><span>
|
||||
</span><a name="line-202"></a><span class="hs-comment">-- | dispatch an InitRequest</span><span>
|
||||
</span><a name="line-203"></a><span class="hs-identifier">dispatchInitUnsafe</span><span>
|
||||
</span><a name="line-204"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Manager</span><span> </span><span class="hs-comment">-- ^ http-client Connection manager</span><span>
|
||||
</span><a name="line-205"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-206"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160706"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160707"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160708"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160709"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ init request</span><span>
|
||||
</span><a name="line-207"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Response</span><span> </span><span class="hs-identifier hs-type">BCL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ response</span><span>
|
||||
</span><a name="line-208"></a><a name="dispatchInitUnsafe"><a href="SwaggerPetstore.Client.html#dispatchInitUnsafe"><span class="hs-identifier">dispatchInitUnsafe</span></a></a><span> </span><a name="local-6989586621679160759"><a href="#local-6989586621679160759"><span class="hs-identifier">manager</span></a></a><span> </span><a name="local-6989586621679160760"><a href="#local-6989586621679160760"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679160761"><a href="#local-6989586621679160761"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-209"></a><span> </span><a href="SwaggerPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier hs-var">runConfigLogWithExceptions</span></a><span> </span><a href="#local-6989586621679160762"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="#local-6989586621679160760"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-210"></a><span> </span><span class="hs-keyword">do</span><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160762"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelInfo"><span class="hs-identifier hs-var">levelInfo</span></a><span> </span><a href="#local-6989586621679160764"><span class="hs-identifier hs-var">requestLogMsg</span></a><span>
|
||||
</span><a name="line-211"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160762"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelDebug"><span class="hs-identifier hs-var">levelDebug</span></a><span> </span><a href="#local-6989586621679160765"><span class="hs-identifier hs-var">requestDbgLogMsg</span></a><span>
|
||||
</span><a name="line-212"></a><span> </span><a name="local-6989586621679161197"><a href="#local-6989586621679161197"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">liftIO</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">httpLbs</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span> </span><a href="#local-6989586621679160759"><span class="hs-identifier hs-var">manager</span></a><span>
|
||||
</span><a name="line-213"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160762"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelInfo"><span class="hs-identifier hs-var">levelInfo</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679160767"><span class="hs-identifier hs-var">responseLogMsg</span></a><span> </span><a href="#local-6989586621679161197"><span class="hs-identifier hs-var">res</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-214"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679160762"><span class="hs-identifier hs-var">src</span></a><span> </span><a href="SwaggerPetstore.Logging.html#levelDebug"><span class="hs-identifier hs-var">levelDebug</span></a><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679161197"><span class="hs-identifier hs-var">res</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-215"></a><span> </span><span class="hs-identifier hs-var">return</span><span> </span><a href="#local-6989586621679161197"><span class="hs-identifier hs-var">res</span></a><span>
|
||||
</span><a name="line-216"></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-217"></a><span> </span><a name="local-6989586621679160762"><a href="#local-6989586621679160762"><span class="hs-identifier">src</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"Client"</span><span>
|
||||
</span><a name="line-218"></a><span> </span><a name="local-6989586621679160763"><a href="#local-6989586621679160763"><span class="hs-identifier">endpoint</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-219"></a><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-220"></a><span> </span><span class="hs-identifier hs-var">BC</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><span class="hs-operator hs-var">$</span><span>
|
||||
</span><a name="line-221"></a><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">method</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">" "</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">host</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">path</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">queryString</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span>
|
||||
</span><a name="line-222"></a><span> </span><a name="local-6989586621679160764"><a href="#local-6989586621679160764"><span class="hs-identifier">requestLogMsg</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-string">"REQ:"</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">endpoint</span></a><span>
|
||||
</span><a name="line-223"></a><span> </span><a name="local-6989586621679160765"><a href="#local-6989586621679160765"><span class="hs-identifier">requestDbgLogMsg</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-224"></a><span> </span><span class="hs-string">"Headers="</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestHeaders</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">" Body="</span><span> </span><span class="hs-operator hs-var"><></span><span>
|
||||
</span><a name="line-225"></a><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><a href="#local-6989586621679160761"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-226"></a><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyLBS</span><span> </span><a name="local-6989586621679160768"><a href="#local-6989586621679160768"><span class="hs-identifier">xs</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">decodeUtf8</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toStrict</span><span> </span><a href="#local-6989586621679160768"><span class="hs-identifier hs-var">xs</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-227"></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-string">"<RequestBody>"</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-228"></a><span> </span><a name="local-6989586621679160766"><a href="#local-6989586621679160766"><span class="hs-identifier">responseStatusCode</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">statusCode</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">responseStatus</span><span>
|
||||
</span><a name="line-229"></a><span> </span><a name="local-6989586621679160767"><a href="#local-6989586621679160767"><span class="hs-identifier">responseLogMsg</span></a></a><span> </span><a name="local-6989586621679161143"><a href="#local-6989586621679161143"><span class="hs-identifier">res</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-230"></a><span> </span><span class="hs-string">"RES:statusCode="</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><a href="#local-6989586621679160766"><span class="hs-identifier hs-var">responseStatusCode</span></a><span> </span><a href="#local-6989586621679161143"><span class="hs-identifier hs-var">res</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">" ("</span><span> </span><span class="hs-operator hs-var"><></span><span> </span><a href="#local-6989586621679160763"><span class="hs-identifier hs-var">endpoint</span></a><span> </span><span class="hs-operator hs-var"><></span><span> </span><span class="hs-string">")"</span><span>
|
||||
</span><a name="line-231"></a><span>
|
||||
</span><a name="line-232"></a><span class="hs-comment">-- * InitRequest</span><span>
|
||||
</span><a name="line-233"></a><span>
|
||||
</span><a name="line-234"></a><span class="hs-comment">-- | wraps an http-client 'Request' with request/response type parameters</span><span>
|
||||
</span><a name="line-235"></a><span class="hs-keyword">newtype</span><span> </span><a name="InitRequest"><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier">InitRequest</span></a></a><span> </span><a name="local-6989586621679160683"><a href="#local-6989586621679160683"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679160684"><a href="#local-6989586621679160684"><span class="hs-identifier">contentType</span></a></a><span> </span><a name="local-6989586621679160685"><a href="#local-6989586621679160685"><span class="hs-identifier">res</span></a></a><span> </span><a name="local-6989586621679160686"><a href="#local-6989586621679160686"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="InitRequest"><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier">InitRequest</span></a></a><span>
|
||||
</span><a name="line-236"></a><span> </span><span class="hs-special">{</span><span> </span><a name="unInitRequest"><a href="SwaggerPetstore.Client.html#unInitRequest"><span class="hs-identifier">unInitRequest</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span>
|
||||
</span><a name="line-237"></a><span> </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-238"></a><span>
|
||||
</span><a name="line-239"></a><span class="hs-comment">-- | Build an http-client 'Request' record from the supplied config and request</span><span>
|
||||
</span><a name="line-240"></a><span class="hs-identifier">_toInitRequest</span><span>
|
||||
</span><a name="line-241"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160702"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">,</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679160703"><span class="hs-identifier hs-type">contentType</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-242"></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-comment">-- ^ config</span><span>
|
||||
</span><a name="line-243"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160704"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160703"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160705"><span class="hs-identifier hs-type">res</span></a><span> </span><span class="hs-comment">-- ^ request</span><span>
|
||||
</span><a name="line-244"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160702"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-comment">-- ^ "accept" 'MimeType'</span><span>
|
||||
</span><a name="line-245"></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160704"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160703"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160705"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160702"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ initialized request</span><span>
|
||||
</span><a name="line-246"></a><a name="_toInitRequest"><a href="SwaggerPetstore.Client.html#_toInitRequest"><span class="hs-identifier">_toInitRequest</span></a></a><span> </span><a name="local-6989586621679161198"><a href="#local-6989586621679161198"><span class="hs-identifier">config</span></a></a><span> </span><a name="local-6989586621679161199"><a href="#local-6989586621679161199"><span class="hs-identifier">req0</span></a></a><span> </span><a name="local-6989586621679161200"><a href="#local-6989586621679161200"><span class="hs-identifier">accept</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-247"></a><span> </span><a name="local-6989586621679161201"><a href="#local-6989586621679161201"><span class="hs-identifier">parsedReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">parseRequest</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">append</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configHost</span><span> </span><a href="#local-6989586621679161198"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">concat</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rUrlPath</span><span> </span><a href="#local-6989586621679161199"><span class="hs-identifier hs-var">req0</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-248"></a><span> </span><span class="hs-keyword">let</span><span> </span><a name="local-6989586621679161202"><a href="#local-6989586621679161202"><span class="hs-identifier">req1</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Client.html#_applyAuthMethods"><span class="hs-identifier hs-var">_applyAuthMethods</span></a><span> </span><a href="#local-6989586621679161199"><span class="hs-identifier hs-var">req0</span></a><span> </span><a href="#local-6989586621679161198"><span class="hs-identifier hs-var">config</span></a><span>
|
||||
</span><a name="line-249"></a><span> </span><span class="hs-operator hs-var">&</span><span> </span><a href="SwaggerPetstore.API.html#_setContentTypeHeader"><span class="hs-identifier hs-var">_setContentTypeHeader</span></a><span>
|
||||
</span><a name="line-250"></a><span> </span><span class="hs-operator hs-var">&</span><span> </span><span class="hs-identifier hs-var">flip</span><span> </span><a href="SwaggerPetstore.API.html#_setAcceptHeader"><span class="hs-identifier hs-var">_setAcceptHeader</span></a><span> </span><a href="#local-6989586621679161200"><span class="hs-identifier hs-var">accept</span></a><span>
|
||||
</span><a name="line-251"></a><span> </span><a name="local-6989586621679161203"><a href="#local-6989586621679161203"><span class="hs-identifier">reqHeaders</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-string">"User-Agent"</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toHeader</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">configUserAgent</span><span> </span><a href="#local-6989586621679161198"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">:</span><span> </span><span class="hs-identifier">paramsHeaders</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679161202"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-252"></a><span> </span><a name="local-6989586621679161204"><a href="#local-6989586621679161204"><span class="hs-identifier">reqQuery</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">renderQuery</span><span> </span><span class="hs-identifier hs-var">True</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">paramsQuery</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679161202"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-253"></a><span> </span><a name="local-6989586621679161205"><a href="#local-6989586621679161205"><span class="hs-identifier">pReq</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161201"><span class="hs-identifier hs-var">parsedReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">method</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rMethod</span><span> </span><a href="#local-6989586621679161202"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-254"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestHeaders</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161203"><span class="hs-identifier hs-var">reqHeaders</span></a><span>
|
||||
</span><a name="line-255"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">queryString</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161204"><span class="hs-identifier hs-var">reqQuery</span></a><span>
|
||||
</span><a name="line-256"></a><span> </span><span class="hs-special">}</span><span>
|
||||
</span><a name="line-257"></a><span> </span><a name="local-6989586621679161210"><a href="#local-6989586621679161210"><span class="hs-identifier">outReq</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">paramsBody</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">rParams</span><span> </span><a href="#local-6989586621679161202"><span class="hs-identifier hs-var">req1</span></a><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-258"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyNone"><span class="hs-identifier hs-var">ParamBodyNone</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161205"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">mempty</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-259"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyB"><span class="hs-identifier hs-var">ParamBodyB</span></a><span> </span><a name="local-6989586621679161206"><a href="#local-6989586621679161206"><span class="hs-identifier">bs</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161205"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyBS</span><span> </span><a href="#local-6989586621679161206"><span class="hs-identifier hs-var">bs</span></a><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-260"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyBL"><span class="hs-identifier hs-var">ParamBodyBL</span></a><span> </span><a name="local-6989586621679161207"><a href="#local-6989586621679161207"><span class="hs-identifier">bl</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161205"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyLBS</span><span> </span><a href="#local-6989586621679161207"><span class="hs-identifier hs-var">bl</span></a><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-261"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyFormUrlEncoded"><span class="hs-identifier hs-var">ParamBodyFormUrlEncoded</span></a><span> </span><a name="local-6989586621679161208"><a href="#local-6989586621679161208"><span class="hs-identifier">form</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161205"><span class="hs-identifier hs-var">pReq</span></a><span> </span><span class="hs-special">{</span><span> </span><span class="hs-identifier">NH</span><span class="hs-operator">.</span><span class="hs-identifier">requestBody</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">RequestBodyLBS</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">urlEncodeForm</span><span> </span><a href="#local-6989586621679161208"><span class="hs-identifier hs-var">form</span></a><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-262"></a><span> </span><a href="SwaggerPetstore.API.html#ParamBodyMultipartFormData"><span class="hs-identifier hs-var">ParamBodyMultipartFormData</span></a><span> </span><a name="local-6989586621679161209"><a href="#local-6989586621679161209"><span class="hs-identifier">parts</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">NH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">formDataBody</span><span> </span><a href="#local-6989586621679161209"><span class="hs-identifier hs-var">parts</span></a><span> </span><a href="#local-6989586621679161205"><span class="hs-identifier hs-var">pReq</span></a><span>
|
||||
</span><a name="line-263"></a><span>
|
||||
</span><a name="line-264"></a><span> </span><span class="hs-identifier hs-var">pure</span><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a href="#local-6989586621679161210"><span class="hs-identifier hs-var">outReq</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-265"></a><span>
|
||||
</span><a name="line-266"></a><span class="hs-comment">-- | apply all matching AuthMethods in config to request</span><span>
|
||||
</span><a name="line-267"></a><span class="hs-identifier">_applyAuthMethods</span><span>
|
||||
</span><a name="line-268"></a><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160699"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160700"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160701"><span class="hs-identifier hs-type">res</span></a><span>
|
||||
</span><a name="line-269"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span>
|
||||
</span><a name="line-270"></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.API.html#SwaggerPetstoreRequest"><span class="hs-identifier hs-type">SwaggerPetstoreRequest</span></a><span> </span><a href="#local-6989586621679160699"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160700"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160701"><span class="hs-identifier hs-type">res</span></a><span>
|
||||
</span><a name="line-271"></a><a name="_applyAuthMethods"><a href="SwaggerPetstore.Client.html#_applyAuthMethods"><span class="hs-identifier">_applyAuthMethods</span></a></a><span> </span><a name="local-6989586621679161211"><a href="#local-6989586621679161211"><span class="hs-identifier">req</span></a></a><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-var">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-special">{</span><span class="hs-identifier">configAuthMethods</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">as</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-272"></a><span> </span><span class="hs-identifier hs-var">foldl</span><span> </span><a href="#local-6989586621679161213"><span class="hs-identifier hs-var">go</span></a><span> </span><a href="#local-6989586621679161211"><span class="hs-identifier hs-var">req</span></a><span> </span><span class="hs-keyword">as</span><span>
|
||||
</span><a name="line-273"></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-274"></a><span> </span><a name="local-6989586621679161213"><a href="#local-6989586621679161213"><span class="hs-identifier">go</span></a></a><span> </span><a name="local-6989586621679161214"><a href="#local-6989586621679161214"><span class="hs-identifier">r</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.API.html#AnyAuthMethod"><span class="hs-identifier hs-var">AnyAuthMethod</span></a><span> </span><a name="local-6989586621679161215"><a href="#local-6989586621679161215"><span class="hs-identifier">a</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="#local-6989586621679161214"><span class="hs-identifier hs-var">r</span></a><span> </span><span class="hs-special">`</span><a href="SwaggerPetstore.API.html#applyAuthMethod"><span class="hs-identifier hs-var">applyAuthMethod</span></a><span class="hs-special">`</span><span> </span><a href="#local-6989586621679161215"><span class="hs-identifier hs-var">a</span></a><span>
|
||||
</span><a name="line-275"></a><span>
|
||||
</span><a name="line-276"></a><span class="hs-comment">-- | modify the underlying Request</span><span>
|
||||
</span><a name="line-277"></a><span class="hs-identifier">modifyInitRequest</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160695"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160696"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160697"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160698"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160695"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160696"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160697"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160698"><span class="hs-identifier hs-type">accept</span></a><span> </span><span>
|
||||
</span><a name="line-278"></a><a name="modifyInitRequest"><a href="SwaggerPetstore.Client.html#modifyInitRequest"><span class="hs-identifier">modifyInitRequest</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679161216"><a href="#local-6989586621679161216"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><a name="local-6989586621679161217"><a href="#local-6989586621679161217"><span class="hs-identifier">f</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161217"><span class="hs-identifier hs-var">f</span></a><span> </span><a href="#local-6989586621679161216"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-279"></a><span>
|
||||
</span><a name="line-280"></a><span class="hs-comment">-- | modify the underlying Request (monadic)</span><span>
|
||||
</span><a name="line-281"></a><span class="hs-identifier">modifyInitRequestM</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">Monad</span><span> </span><a href="#local-6989586621679160690"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160691"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160692"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160693"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160694"><span class="hs-identifier hs-type">accept</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160690"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-identifier hs-type">NH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Request</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679160690"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-type">InitRequest</span></a><span> </span><a href="#local-6989586621679160691"><span class="hs-identifier hs-type">req</span></a><span> </span><a href="#local-6989586621679160692"><span class="hs-identifier hs-type">contentType</span></a><span> </span><a href="#local-6989586621679160693"><span class="hs-identifier hs-type">res</span></a><span> </span><a href="#local-6989586621679160694"><span class="hs-identifier hs-type">accept</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-282"></a><a name="modifyInitRequestM"><a href="SwaggerPetstore.Client.html#modifyInitRequestM"><span class="hs-identifier">modifyInitRequestM</span></a></a><span> </span><span class="hs-special">(</span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><a name="local-6989586621679161218"><a href="#local-6989586621679161218"><span class="hs-identifier">req</span></a></a><span class="hs-special">)</span><span> </span><a name="local-6989586621679161219"><a href="#local-6989586621679161219"><span class="hs-identifier">f</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">fmap</span><span> </span><a href="SwaggerPetstore.Client.html#InitRequest"><span class="hs-identifier hs-var">InitRequest</span></a><span> </span><span class="hs-special">(</span><a href="#local-6989586621679161219"><span class="hs-identifier hs-var">f</span></a><span> </span><a href="#local-6989586621679161218"><span class="hs-identifier hs-var">req</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-283"></a><span>
|
||||
</span><a name="line-284"></a><span class="hs-comment">-- ** Logging </span><span>
|
||||
</span><a name="line-285"></a><span>
|
||||
</span><a name="line-286"></a><span class="hs-comment">-- | Run a block using the configured logger instance</span><span>
|
||||
</span><a name="line-287"></a><span class="hs-identifier">runConfigLog</span><span>
|
||||
</span><a name="line-288"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadIO</span><span> </span><a href="#local-6989586621679160689"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-289"></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679160689"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-290"></a><a name="runConfigLog"><a href="SwaggerPetstore.Client.html#runConfigLog"><span class="hs-identifier">runConfigLog</span></a></a><span> </span><a name="local-6989586621679161220"><a href="#local-6989586621679161220"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">configLogExecWithContext</span><span> </span><a href="#local-6989586621679161220"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier">configLogContext</span><span> </span><a href="#local-6989586621679161220"><span class="hs-identifier hs-var">config</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-291"></a><span>
|
||||
</span><a name="line-292"></a><span class="hs-comment">-- | Run a block using the configured logger instance (logs exceptions)</span><span>
|
||||
</span><a name="line-293"></a><span class="hs-identifier">runConfigLogWithExceptions</span><span>
|
||||
</span><a name="line-294"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">E</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadCatch</span><span> </span><a href="#local-6989586621679160688"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadIO</span><span> </span><a href="#local-6989586621679160688"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-295"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Client.html#SwaggerPetstoreConfig"><span class="hs-identifier hs-type">SwaggerPetstoreConfig</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679160688"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-296"></a><a name="runConfigLogWithExceptions"><a href="SwaggerPetstore.Client.html#runConfigLogWithExceptions"><span class="hs-identifier">runConfigLogWithExceptions</span></a></a><span> </span><a name="local-6989586621679161221"><a href="#local-6989586621679161221"><span class="hs-identifier">src</span></a></a><span> </span><a name="local-6989586621679161222"><a href="#local-6989586621679161222"><span class="hs-identifier">config</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Client.html#runConfigLog"><span class="hs-identifier hs-var">runConfigLog</span></a><span> </span><a href="#local-6989586621679161222"><span class="hs-identifier hs-var">config</span></a><span> </span><span class="hs-operator hs-var">.</span><span> </span><a href="SwaggerPetstore.Logging.html#logExceptions"><span class="hs-identifier hs-var">logExceptions</span></a><span> </span><a href="#local-6989586621679161221"><span class="hs-identifier hs-var">src</span></a><span>
|
||||
</span><a name="line-297"></a></pre></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -3,117 +3,118 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}</span><span>
|
||||
</span><a name="line-10"></a><span>
|
||||
</span><a name="line-11"></a><span class="hs-comment">{-|
|
||||
</span><a name="line-11"></a><span>
|
||||
</span><a name="line-12"></a><span class="hs-comment">{-|
|
||||
Module : SwaggerPetstore.Logging
|
||||
Katip Logging functions
|
||||
-}</span><span>
|
||||
</span><a name="line-15"></a><span>
|
||||
</span><a name="line-16"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
|
||||
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
||||
</span><a name="line-19"></a><span>
|
||||
</span><a name="line-20"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-21"></a><span>
|
||||
</span><a name="line-22"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Text</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-23"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC</span><span class="hs-operator">.</span><span class="hs-identifier">Exts</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">IsString</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-24"></a><span>
|
||||
</span><a name="line-25"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Exception</span><span class="hs-operator">.</span><span class="hs-identifier">Safe</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">E</span><span>
|
||||
</span><a name="line-26"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">IO</span><span class="hs-operator">.</span><span class="hs-identifier">Class</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">Trans</span><span class="hs-operator">.</span><span class="hs-identifier">Reader</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Lens</span><span class="hs-operator">.</span><span class="hs-identifier">Micro</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">L</span><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">System</span><span class="hs-operator">.</span><span class="hs-identifier">IO</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">IO</span><span>
|
||||
</span><a name="line-31"></a><span>
|
||||
</span><a name="line-32"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Katip</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">LG</span><span>
|
||||
</span><a name="line-33"></a><span>
|
||||
</span><a name="line-34"></a><span class="hs-comment">-- * Type Aliases (for compatability)</span><span>
|
||||
</span><a name="line-35"></a><span>
|
||||
</span><a name="line-36"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-37"></a><span class="hs-keyword">type</span><span> </span><a name="LogExecWithContext"><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier">LogExecWithContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><a name="local-6989586621679096641"><a href="#local-6989586621679096641"><span class="hs-identifier">m</span></a></a><span class="hs-operator">.</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadIO</span><span> </span><a href="#local-6989586621679096641"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-glyph">=></span><span>
|
||||
</span><a name="line-38"></a><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679096641"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-39"></a><span>
|
||||
</span><a name="line-40"></a><span class="hs-comment">-- | A Katip logging block</span><span>
|
||||
</span><a name="line-41"></a><span class="hs-keyword">type</span><span> </span><a name="LogExec"><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier">LogExec</span></a></a><span> </span><a name="local-6989586621679096639"><a href="#local-6989586621679096639"><span class="hs-identifier">m</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><a name="local-6989586621679096640"><a href="#local-6989586621679096640"><span class="hs-identifier">a</span></a></a><span class="hs-operator">.</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">KatipT</span><span> </span><a href="#local-6989586621679096639"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679096640"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679096639"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679096640"><span class="hs-identifier hs-type">a</span></a><span>
|
||||
</span><a name="line-42"></a><span>
|
||||
</span><a name="line-43"></a><span class="hs-comment">-- | A Katip Log environment</span><span>
|
||||
</span><a name="line-44"></a><span class="hs-keyword">type</span><span> </span><a name="LogContext"><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier">LogContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">LogEnv</span><span>
|
||||
</span><a name="line-45"></a><span>
|
||||
</span><a name="line-46"></a><span class="hs-comment">-- | A Katip Log severity</span><span>
|
||||
</span><a name="line-47"></a><span class="hs-keyword">type</span><span> </span><a name="LogLevel"><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier">LogLevel</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Severity</span><span>
|
||||
</span><a name="line-48"></a><span>
|
||||
</span><a name="line-49"></a><span class="hs-comment">-- * default logger</span><span>
|
||||
</span><a name="line-50"></a><span>
|
||||
</span><a name="line-51"></a><span class="hs-comment">-- | the default log environment</span><span>
|
||||
</span><a name="line-52"></a><span class="hs-identifier">initLogContext</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span>
|
||||
</span><a name="line-53"></a><a name="initLogContext"><a href="SwaggerPetstore.Logging.html#initLogContext"><span class="hs-identifier">initLogContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">initLogEnv</span><span> </span><span class="hs-string">"SwaggerPetstore"</span><span> </span><span class="hs-string">"dev"</span><span>
|
||||
</span><a name="line-54"></a><span>
|
||||
</span><a name="line-55"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-56"></a><span class="hs-identifier">runDefaultLogExecWithContext</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-57"></a><a name="runDefaultLogExecWithContext"><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier">runDefaultLogExecWithContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">runKatipT</span><span>
|
||||
</span><a name="line-58"></a><span>
|
||||
</span><a name="line-59"></a><span class="hs-comment">-- * stdout logger</span><span>
|
||||
</span><a name="line-60"></a><span>
|
||||
</span><a name="line-61"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-62"></a><span class="hs-identifier">stdoutLoggingExec</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-63"></a><a name="stdoutLoggingExec"><a href="SwaggerPetstore.Logging.html#stdoutLoggingExec"><span class="hs-identifier">stdoutLoggingExec</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a><span>
|
||||
</span><a name="line-64"></a><span>
|
||||
</span><a name="line-65"></a><span class="hs-comment">-- | A Katip Log environment which targets stdout</span><span>
|
||||
</span><a name="line-66"></a><span class="hs-identifier">stdoutLoggingContext</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span>
|
||||
</span><a name="line-67"></a><a name="stdoutLoggingContext"><a href="SwaggerPetstore.Logging.html#stdoutLoggingContext"><span class="hs-identifier">stdoutLoggingContext</span></a></a><span> </span><a name="local-6989586621679097049"><a href="#local-6989586621679097049"><span class="hs-identifier">cxt</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-68"></a><span> </span><a name="local-6989586621679097185"><a href="#local-6989586621679097185"><span class="hs-identifier">handleScribe</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">mkHandleScribe</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ColorIfTerminal</span><span> </span><span class="hs-identifier hs-var">IO</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">stdout</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">InfoS</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">V2</span><span>
|
||||
</span><a name="line-69"></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">registerScribe</span><span> </span><span class="hs-string">"stdout"</span><span> </span><a href="#local-6989586621679097185"><span class="hs-identifier hs-var">handleScribe</span></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">defaultScribeSettings</span><span> </span><a href="#local-6989586621679097049"><span class="hs-identifier hs-var">cxt</span></a><span>
|
||||
</span><a name="line-70"></a><span>
|
||||
</span><a name="line-71"></a><span class="hs-comment">-- * stderr logger</span><span>
|
||||
</span><a name="line-72"></a><span>
|
||||
</span><a name="line-73"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-74"></a><span class="hs-identifier">stderrLoggingExec</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-75"></a><a name="stderrLoggingExec"><a href="SwaggerPetstore.Logging.html#stderrLoggingExec"><span class="hs-identifier">stderrLoggingExec</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a><span>
|
||||
</span><a name="line-76"></a><span>
|
||||
</span><a name="line-77"></a><span class="hs-comment">-- | A Katip Log environment which targets stderr</span><span>
|
||||
</span><a name="line-78"></a><span class="hs-identifier">stderrLoggingContext</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span>
|
||||
</span><a name="line-79"></a><a name="stderrLoggingContext"><a href="SwaggerPetstore.Logging.html#stderrLoggingContext"><span class="hs-identifier">stderrLoggingContext</span></a></a><span> </span><a name="local-6989586621679097186"><a href="#local-6989586621679097186"><span class="hs-identifier">cxt</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-80"></a><span> </span><a name="local-6989586621679097187"><a href="#local-6989586621679097187"><span class="hs-identifier">handleScribe</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">mkHandleScribe</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ColorIfTerminal</span><span> </span><span class="hs-identifier hs-var">IO</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">stderr</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">InfoS</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">V2</span><span>
|
||||
</span><a name="line-81"></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">registerScribe</span><span> </span><span class="hs-string">"stderr"</span><span> </span><a href="#local-6989586621679097187"><span class="hs-identifier hs-var">handleScribe</span></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">defaultScribeSettings</span><span> </span><a href="#local-6989586621679097186"><span class="hs-identifier hs-var">cxt</span></a><span>
|
||||
</span><a name="line-82"></a><span>
|
||||
</span><a name="line-83"></a><span class="hs-comment">-- * Null logger</span><span>
|
||||
</span><a name="line-84"></a><span>
|
||||
</span><a name="line-85"></a><span class="hs-comment">-- | Disables Katip logging</span><span>
|
||||
</span><a name="line-86"></a><span class="hs-identifier">runNullLogExec</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-87"></a><a name="runNullLogExec"><a href="SwaggerPetstore.Logging.html#runNullLogExec"><span class="hs-identifier">runNullLogExec</span></a></a><span> </span><a name="local-6989586621679097188"><a href="#local-6989586621679097188"><span class="hs-identifier">le</span></a></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">KatipT</span><span> </span><a name="local-6989586621679097189"><a href="#local-6989586621679097189"><span class="hs-identifier">f</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">P</span><span class="hs-operator">.</span><span class="hs-identifier">runReaderT</span><span> </span><a href="#local-6989586621679097189"><span class="hs-identifier hs-var">f</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">L</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">set</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">logEnvScribes</span><span> </span><span class="hs-identifier hs-var">mempty</span><span> </span><a href="#local-6989586621679097188"><span class="hs-identifier hs-var">le</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-88"></a><span>
|
||||
</span><a name="line-89"></a><span class="hs-comment">-- * Log Msg</span><span>
|
||||
</span><a name="line-90"></a><span>
|
||||
</span><a name="line-91"></a><span class="hs-comment">-- | Log a katip message</span><span>
|
||||
</span><a name="line-92"></a><span class="hs-identifier">_log</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Applicative</span><span> </span><a href="#local-6989586621679097048"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Katip</span><span> </span><a href="#local-6989586621679097048"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679097048"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-93"></a><a name="_log"><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier">_log</span></a></a><span> </span><a name="local-6989586621679097190"><a href="#local-6989586621679097190"><span class="hs-identifier">src</span></a></a><span> </span><a name="local-6989586621679097191"><a href="#local-6989586621679097191"><span class="hs-identifier">level</span></a></a><span> </span><a name="local-6989586621679097192"><a href="#local-6989586621679097192"><span class="hs-identifier">msg</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-94"></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">logMsg</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><a href="#local-6989586621679097190"><span class="hs-identifier hs-var">src</span></a><span class="hs-special">)</span><span> </span><a href="#local-6989586621679097191"><span class="hs-identifier hs-var">level</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">logStr</span><span> </span><a href="#local-6989586621679097192"><span class="hs-identifier hs-var">msg</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-95"></a><span>
|
||||
</span><a name="line-96"></a><span class="hs-comment">-- * Log Exceptions</span><span>
|
||||
</span><a name="line-97"></a><span>
|
||||
</span><a name="line-98"></a><span class="hs-comment">-- | re-throws exceptions after logging them</span><span>
|
||||
</span><a name="line-99"></a><span class="hs-identifier">logExceptions</span><span>
|
||||
</span><a name="line-100"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Katip</span><span> </span><a href="#local-6989586621679096642"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">E</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadCatch</span><span> </span><a href="#local-6989586621679096642"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Applicative</span><span> </span><a href="#local-6989586621679096642"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-101"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679096642"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679096643"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679096642"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679096643"><span class="hs-identifier hs-type">a</span></a><span>
|
||||
</span><a name="line-102"></a><a name="logExceptions"><a href="SwaggerPetstore.Logging.html#logExceptions"><span class="hs-identifier">logExceptions</span></a></a><span> </span><a name="local-6989586621679097193"><a href="#local-6989586621679097193"><span class="hs-identifier">src</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-103"></a><span> </span><span class="hs-identifier hs-var">E</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">handle</span><span>
|
||||
</span><a name="line-104"></a><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><a name="local-6989586621679097454"><a href="#local-6989586621679097454"><span class="hs-identifier">e</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">E</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">SomeException</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-105"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679097193"><span class="hs-identifier hs-var">src</span></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ErrorS</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679097454"><span class="hs-identifier hs-var">e</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-106"></a><span> </span><span class="hs-identifier hs-var">E</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">throw</span><span> </span><a href="#local-6989586621679097454"><span class="hs-identifier hs-var">e</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-107"></a><span>
|
||||
</span><a name="line-108"></a><span class="hs-comment">-- * Log Level</span><span>
|
||||
</span><a name="line-109"></a><span>
|
||||
</span><a name="line-110"></a><span class="hs-identifier">levelInfo</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span>
|
||||
</span><a name="line-111"></a><a name="levelInfo"><a href="SwaggerPetstore.Logging.html#levelInfo"><span class="hs-identifier">levelInfo</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">InfoS</span><span>
|
||||
</span><a name="line-112"></a><span>
|
||||
</span><a name="line-113"></a><span class="hs-identifier">levelError</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span>
|
||||
</span><a name="line-114"></a><a name="levelError"><a href="SwaggerPetstore.Logging.html#levelError"><span class="hs-identifier">levelError</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ErrorS</span><span>
|
||||
</span><a name="line-115"></a><span>
|
||||
</span><a name="line-116"></a><span class="hs-identifier">levelDebug</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span>
|
||||
</span><a name="line-117"></a><a name="levelDebug"><a href="SwaggerPetstore.Logging.html#levelDebug"><span class="hs-identifier">levelDebug</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">DebugS</span><span>
|
||||
</span><a name="line-118"></a><span>
|
||||
</span><a name="line-119"></a></pre></body></html>
|
||||
</span><a name="line-16"></a><span>
|
||||
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
|
||||
</span><a name="line-19"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
||||
</span><a name="line-20"></a><span>
|
||||
</span><a name="line-21"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-22"></a><span>
|
||||
</span><a name="line-23"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Text</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-24"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC</span><span class="hs-operator">.</span><span class="hs-identifier">Exts</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">IsString</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-25"></a><span>
|
||||
</span><a name="line-26"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Exception</span><span class="hs-operator">.</span><span class="hs-identifier">Safe</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">E</span><span>
|
||||
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">IO</span><span class="hs-operator">.</span><span class="hs-identifier">Class</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Monad</span><span class="hs-operator">.</span><span class="hs-identifier">Trans</span><span class="hs-operator">.</span><span class="hs-identifier">Reader</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Lens</span><span class="hs-operator">.</span><span class="hs-identifier">Micro</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">L</span><span>
|
||||
</span><a name="line-31"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">System</span><span class="hs-operator">.</span><span class="hs-identifier">IO</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">IO</span><span>
|
||||
</span><a name="line-32"></a><span>
|
||||
</span><a name="line-33"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Katip</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">LG</span><span>
|
||||
</span><a name="line-34"></a><span>
|
||||
</span><a name="line-35"></a><span class="hs-comment">-- * Type Aliases (for compatability)</span><span>
|
||||
</span><a name="line-36"></a><span>
|
||||
</span><a name="line-37"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-38"></a><span class="hs-keyword">type</span><span> </span><a name="LogExecWithContext"><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier">LogExecWithContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><a name="local-6989586621679101166"><a href="#local-6989586621679101166"><span class="hs-identifier">m</span></a></a><span class="hs-operator">.</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadIO</span><span> </span><a href="#local-6989586621679101166"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-glyph">=></span><span>
|
||||
</span><a name="line-39"></a><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier hs-type">LogExec</span></a><span> </span><a href="#local-6989586621679101166"><span class="hs-identifier hs-type">m</span></a><span>
|
||||
</span><a name="line-40"></a><span>
|
||||
</span><a name="line-41"></a><span class="hs-comment">-- | A Katip logging block</span><span>
|
||||
</span><a name="line-42"></a><span class="hs-keyword">type</span><span> </span><a name="LogExec"><a href="SwaggerPetstore.Logging.html#LogExec"><span class="hs-identifier">LogExec</span></a></a><span> </span><a name="local-6989586621679101164"><a href="#local-6989586621679101164"><span class="hs-identifier">m</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><a name="local-6989586621679101165"><a href="#local-6989586621679101165"><span class="hs-identifier">a</span></a></a><span class="hs-operator">.</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">KatipT</span><span> </span><a href="#local-6989586621679101164"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679101165"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679101164"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679101165"><span class="hs-identifier hs-type">a</span></a><span>
|
||||
</span><a name="line-43"></a><span>
|
||||
</span><a name="line-44"></a><span class="hs-comment">-- | A Katip Log environment</span><span>
|
||||
</span><a name="line-45"></a><span class="hs-keyword">type</span><span> </span><a name="LogContext"><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier">LogContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">LogEnv</span><span>
|
||||
</span><a name="line-46"></a><span>
|
||||
</span><a name="line-47"></a><span class="hs-comment">-- | A Katip Log severity</span><span>
|
||||
</span><a name="line-48"></a><span class="hs-keyword">type</span><span> </span><a name="LogLevel"><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier">LogLevel</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Severity</span><span>
|
||||
</span><a name="line-49"></a><span>
|
||||
</span><a name="line-50"></a><span class="hs-comment">-- * default logger</span><span>
|
||||
</span><a name="line-51"></a><span>
|
||||
</span><a name="line-52"></a><span class="hs-comment">-- | the default log environment</span><span>
|
||||
</span><a name="line-53"></a><span class="hs-identifier">initLogContext</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span>
|
||||
</span><a name="line-54"></a><a name="initLogContext"><a href="SwaggerPetstore.Logging.html#initLogContext"><span class="hs-identifier">initLogContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">initLogEnv</span><span> </span><span class="hs-string">"SwaggerPetstore"</span><span> </span><span class="hs-string">"dev"</span><span>
|
||||
</span><a name="line-55"></a><span>
|
||||
</span><a name="line-56"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-57"></a><span class="hs-identifier">runDefaultLogExecWithContext</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-58"></a><a name="runDefaultLogExecWithContext"><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier">runDefaultLogExecWithContext</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">runKatipT</span><span>
|
||||
</span><a name="line-59"></a><span>
|
||||
</span><a name="line-60"></a><span class="hs-comment">-- * stdout logger</span><span>
|
||||
</span><a name="line-61"></a><span>
|
||||
</span><a name="line-62"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-63"></a><span class="hs-identifier">stdoutLoggingExec</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-64"></a><a name="stdoutLoggingExec"><a href="SwaggerPetstore.Logging.html#stdoutLoggingExec"><span class="hs-identifier">stdoutLoggingExec</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a><span>
|
||||
</span><a name="line-65"></a><span>
|
||||
</span><a name="line-66"></a><span class="hs-comment">-- | A Katip Log environment which targets stdout</span><span>
|
||||
</span><a name="line-67"></a><span class="hs-identifier">stdoutLoggingContext</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span>
|
||||
</span><a name="line-68"></a><a name="stdoutLoggingContext"><a href="SwaggerPetstore.Logging.html#stdoutLoggingContext"><span class="hs-identifier">stdoutLoggingContext</span></a></a><span> </span><a name="local-6989586621679101574"><a href="#local-6989586621679101574"><span class="hs-identifier">cxt</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-69"></a><span> </span><a name="local-6989586621679101710"><a href="#local-6989586621679101710"><span class="hs-identifier">handleScribe</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">mkHandleScribe</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ColorIfTerminal</span><span> </span><span class="hs-identifier hs-var">IO</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">stdout</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">InfoS</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">V2</span><span>
|
||||
</span><a name="line-70"></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">registerScribe</span><span> </span><span class="hs-string">"stdout"</span><span> </span><a href="#local-6989586621679101710"><span class="hs-identifier hs-var">handleScribe</span></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">defaultScribeSettings</span><span> </span><a href="#local-6989586621679101574"><span class="hs-identifier hs-var">cxt</span></a><span>
|
||||
</span><a name="line-71"></a><span>
|
||||
</span><a name="line-72"></a><span class="hs-comment">-- * stderr logger</span><span>
|
||||
</span><a name="line-73"></a><span>
|
||||
</span><a name="line-74"></a><span class="hs-comment">-- | Runs a Katip logging block with the Log environment</span><span>
|
||||
</span><a name="line-75"></a><span class="hs-identifier">stderrLoggingExec</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-76"></a><a name="stderrLoggingExec"><a href="SwaggerPetstore.Logging.html#stderrLoggingExec"><span class="hs-identifier">stderrLoggingExec</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.Logging.html#runDefaultLogExecWithContext"><span class="hs-identifier hs-var">runDefaultLogExecWithContext</span></a><span>
|
||||
</span><a name="line-77"></a><span>
|
||||
</span><a name="line-78"></a><span class="hs-comment">-- | A Katip Log environment which targets stderr</span><span>
|
||||
</span><a name="line-79"></a><span class="hs-identifier">stderrLoggingContext</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">IO</span><span> </span><a href="SwaggerPetstore.Logging.html#LogContext"><span class="hs-identifier hs-type">LogContext</span></a><span>
|
||||
</span><a name="line-80"></a><a name="stderrLoggingContext"><a href="SwaggerPetstore.Logging.html#stderrLoggingContext"><span class="hs-identifier">stderrLoggingContext</span></a></a><span> </span><a name="local-6989586621679101711"><a href="#local-6989586621679101711"><span class="hs-identifier">cxt</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-81"></a><span> </span><a name="local-6989586621679101712"><a href="#local-6989586621679101712"><span class="hs-identifier">handleScribe</span></a></a><span> </span><span class="hs-glyph"><-</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">mkHandleScribe</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ColorIfTerminal</span><span> </span><span class="hs-identifier hs-var">IO</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">stderr</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">InfoS</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">V2</span><span>
|
||||
</span><a name="line-82"></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">registerScribe</span><span> </span><span class="hs-string">"stderr"</span><span> </span><a href="#local-6989586621679101712"><span class="hs-identifier hs-var">handleScribe</span></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">defaultScribeSettings</span><span> </span><a href="#local-6989586621679101711"><span class="hs-identifier hs-var">cxt</span></a><span>
|
||||
</span><a name="line-83"></a><span>
|
||||
</span><a name="line-84"></a><span class="hs-comment">-- * Null logger</span><span>
|
||||
</span><a name="line-85"></a><span>
|
||||
</span><a name="line-86"></a><span class="hs-comment">-- | Disables Katip logging</span><span>
|
||||
</span><a name="line-87"></a><span class="hs-identifier">runNullLogExec</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogExecWithContext"><span class="hs-identifier hs-type">LogExecWithContext</span></a><span>
|
||||
</span><a name="line-88"></a><a name="runNullLogExec"><a href="SwaggerPetstore.Logging.html#runNullLogExec"><span class="hs-identifier">runNullLogExec</span></a></a><span> </span><a name="local-6989586621679101713"><a href="#local-6989586621679101713"><span class="hs-identifier">le</span></a></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">KatipT</span><span> </span><a name="local-6989586621679101714"><a href="#local-6989586621679101714"><span class="hs-identifier">f</span></a></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">P</span><span class="hs-operator">.</span><span class="hs-identifier">runReaderT</span><span> </span><a href="#local-6989586621679101714"><span class="hs-identifier hs-var">f</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">L</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">set</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">logEnvScribes</span><span> </span><span class="hs-identifier hs-var">mempty</span><span> </span><a href="#local-6989586621679101713"><span class="hs-identifier hs-var">le</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-89"></a><span>
|
||||
</span><a name="line-90"></a><span class="hs-comment">-- * Log Msg</span><span>
|
||||
</span><a name="line-91"></a><span>
|
||||
</span><a name="line-92"></a><span class="hs-comment">-- | Log a katip message</span><span>
|
||||
</span><a name="line-93"></a><span class="hs-identifier">_log</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Applicative</span><span> </span><a href="#local-6989586621679101573"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Katip</span><span> </span><a href="#local-6989586621679101573"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679101573"><span class="hs-identifier hs-type">m</span></a><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-94"></a><a name="_log"><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier">_log</span></a></a><span> </span><a name="local-6989586621679101715"><a href="#local-6989586621679101715"><span class="hs-identifier">src</span></a></a><span> </span><a name="local-6989586621679101716"><a href="#local-6989586621679101716"><span class="hs-identifier">level</span></a></a><span> </span><a name="local-6989586621679101717"><a href="#local-6989586621679101717"><span class="hs-identifier">msg</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-95"></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">logMsg</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><a href="#local-6989586621679101715"><span class="hs-identifier hs-var">src</span></a><span class="hs-special">)</span><span> </span><a href="#local-6989586621679101716"><span class="hs-identifier hs-var">level</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">logStr</span><span> </span><a href="#local-6989586621679101717"><span class="hs-identifier hs-var">msg</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-96"></a><span>
|
||||
</span><a name="line-97"></a><span class="hs-comment">-- * Log Exceptions</span><span>
|
||||
</span><a name="line-98"></a><span>
|
||||
</span><a name="line-99"></a><span class="hs-comment">-- | re-throws exceptions after logging them</span><span>
|
||||
</span><a name="line-100"></a><span class="hs-identifier">logExceptions</span><span>
|
||||
</span><a name="line-101"></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">LG</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Katip</span><span> </span><a href="#local-6989586621679101167"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">E</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MonadCatch</span><span> </span><a href="#local-6989586621679101167"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">Applicative</span><span> </span><a href="#local-6989586621679101167"><span class="hs-identifier hs-type">m</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-102"></a><span> </span><span class="hs-glyph">=></span><span> </span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679101167"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679101168"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679101167"><span class="hs-identifier hs-type">m</span></a><span> </span><a href="#local-6989586621679101168"><span class="hs-identifier hs-type">a</span></a><span>
|
||||
</span><a name="line-103"></a><a name="logExceptions"><a href="SwaggerPetstore.Logging.html#logExceptions"><span class="hs-identifier">logExceptions</span></a></a><span> </span><a name="local-6989586621679101718"><a href="#local-6989586621679101718"><span class="hs-identifier">src</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-104"></a><span> </span><span class="hs-identifier hs-var">E</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">handle</span><span>
|
||||
</span><a name="line-105"></a><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><a name="local-6989586621679101979"><a href="#local-6989586621679101979"><span class="hs-identifier">e</span></a></a><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">E</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">SomeException</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-keyword">do</span><span>
|
||||
</span><a name="line-106"></a><span> </span><a href="SwaggerPetstore.Logging.html#_log"><span class="hs-identifier hs-var">_log</span></a><span> </span><a href="#local-6989586621679101718"><span class="hs-identifier hs-var">src</span></a><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ErrorS</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">show</span><span class="hs-special">)</span><span> </span><a href="#local-6989586621679101979"><span class="hs-identifier hs-var">e</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-107"></a><span> </span><span class="hs-identifier hs-var">E</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">throw</span><span> </span><a href="#local-6989586621679101979"><span class="hs-identifier hs-var">e</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-108"></a><span>
|
||||
</span><a name="line-109"></a><span class="hs-comment">-- * Log Level</span><span>
|
||||
</span><a name="line-110"></a><span>
|
||||
</span><a name="line-111"></a><span class="hs-identifier">levelInfo</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span>
|
||||
</span><a name="line-112"></a><a name="levelInfo"><a href="SwaggerPetstore.Logging.html#levelInfo"><span class="hs-identifier">levelInfo</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">InfoS</span><span>
|
||||
</span><a name="line-113"></a><span>
|
||||
</span><a name="line-114"></a><span class="hs-identifier">levelError</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span>
|
||||
</span><a name="line-115"></a><a name="levelError"><a href="SwaggerPetstore.Logging.html#levelError"><span class="hs-identifier">levelError</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">ErrorS</span><span>
|
||||
</span><a name="line-116"></a><span>
|
||||
</span><a name="line-117"></a><span class="hs-identifier">levelDebug</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="SwaggerPetstore.Logging.html#LogLevel"><span class="hs-identifier hs-type">LogLevel</span></a><span>
|
||||
</span><a name="line-118"></a><a name="levelDebug"><a href="SwaggerPetstore.Logging.html#levelDebug"><span class="hs-identifier">levelDebug</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">LG</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">DebugS</span><span>
|
||||
</span><a name="line-119"></a><span>
|
||||
</span><a name="line-120"></a></pre></body></html>
|
@ -3,227 +3,228 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}</span><span>
|
||||
</span><a name="line-10"></a><span>
|
||||
</span><a name="line-11"></a><span class="hs-comment">{-|
|
||||
</span><a name="line-11"></a><span>
|
||||
</span><a name="line-12"></a><span class="hs-comment">{-|
|
||||
Module : SwaggerPetstore.MimeTypes
|
||||
-}</span><span>
|
||||
</span><a name="line-14"></a><span>
|
||||
</span><a name="line-15"></a><span class="hs-pragma">{-# LANGUAGE ConstraintKinds #-}</span><span>
|
||||
</span><a name="line-16"></a><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
|
||||
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
|
||||
</span><a name="line-19"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
|
||||
</span><a name="line-20"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
||||
</span><a name="line-21"></a><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}</span><span>
|
||||
</span><a name="line-22"></a><span>
|
||||
</span><a name="line-23"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-24"></a><span>
|
||||
</span><a name="line-25"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Model.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span></a><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">M</span><span>
|
||||
</span><a name="line-26"></a><span>
|
||||
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Aeson</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
|
||||
</span><a name="line-28"></a><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">B</span><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BL</span><span>
|
||||
</span><a name="line-31"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Builder</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BB</span><span>
|
||||
</span><a name="line-32"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BC</span><span>
|
||||
</span><a name="line-33"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BCL</span><span>
|
||||
</span><a name="line-34"></a><span>
|
||||
</span><a name="line-15"></a><span>
|
||||
</span><a name="line-16"></a><span class="hs-pragma">{-# LANGUAGE ConstraintKinds #-}</span><span>
|
||||
</span><a name="line-17"></a><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
|
||||
</span><a name="line-18"></a><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
|
||||
</span><a name="line-19"></a><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
|
||||
</span><a name="line-20"></a><span class="hs-pragma">{-# LANGUAGE OverloadedStrings #-}</span><span>
|
||||
</span><a name="line-21"></a><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables #-}</span><span>
|
||||
</span><a name="line-22"></a><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-unused-binds -fno-warn-unused-imports #-}</span><span>
|
||||
</span><a name="line-23"></a><span>
|
||||
</span><a name="line-24"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-25"></a><span>
|
||||
</span><a name="line-26"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Model.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span></a><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">M</span><span>
|
||||
</span><a name="line-27"></a><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Aeson</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">A</span><span>
|
||||
</span><a name="line-29"></a><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">B</span><span>
|
||||
</span><a name="line-31"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BL</span><span>
|
||||
</span><a name="line-32"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Builder</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BB</span><span>
|
||||
</span><a name="line-33"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BC</span><span>
|
||||
</span><a name="line-34"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">ByteString</span><span class="hs-operator">.</span><span class="hs-identifier">Lazy</span><span class="hs-operator">.</span><span class="hs-identifier">Char8</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">BCL</span><span>
|
||||
</span><a name="line-35"></a><span>
|
||||
</span><a name="line-36"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Media</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">ME</span><span>
|
||||
</span><a name="line-37"></a><span>
|
||||
</span><a name="line-38"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">FormUrlEncoded</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-39"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">HttpApiData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-40"></a><span>
|
||||
</span><a name="line-41"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Data</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-42"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Proxy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Proxy</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-43"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-44"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">String</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-45"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span class="hs-operator">.</span><span class="hs-identifier">Encoding</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-46"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Arrow</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">left</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-47"></a><span>
|
||||
</span><a name="line-48"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Prelude</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var">$</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-operator hs-var">.</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-special">(</span><span class="hs-operator hs-var"><$></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-special">(</span><span class="hs-operator hs-var"><*></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Maybe</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Bool</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Char</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Double</span><span class="hs-special">,</span><span class="hs-identifier hs-type">FilePath</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Float</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Int</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Integer</span><span class="hs-special">,</span><span class="hs-identifier hs-type">String</span><span class="hs-special">,</span><span class="hs-identifier hs-var">fmap</span><span class="hs-special">,</span><span class="hs-identifier hs-var">undefined</span><span class="hs-special">,</span><span class="hs-identifier hs-var">mempty</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-49"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Prelude</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-50"></a><span>
|
||||
</span><a name="line-51"></a><span class="hs-comment">-- * Content Negotiation</span><span>
|
||||
</span><a name="line-52"></a><span>
|
||||
</span><a name="line-53"></a><span class="hs-comment">-- | A type for responses without content-body.</span><span>
|
||||
</span><a name="line-54"></a><span class="hs-keyword">data</span><span> </span><a name="NoContent"><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier">NoContent</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="NoContent"><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier">NoContent</span></a></a><span>
|
||||
</span><a name="line-55"></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Eq</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-56"></a><span>
|
||||
</span><a name="line-57"></a><span class="hs-comment">-- ** Mime Types</span><span>
|
||||
</span><a name="line-58"></a><span>
|
||||
</span><a name="line-59"></a><span class="hs-keyword">data</span><span> </span><a name="MimeJSON"><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier">MimeJSON</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeJSON"><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier">MimeJSON</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-60"></a><span class="hs-keyword">data</span><span> </span><a name="MimeXML"><a href="SwaggerPetstore.MimeTypes.html#MimeXML"><span class="hs-identifier">MimeXML</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeXML"><a href="SwaggerPetstore.MimeTypes.html#MimeXML"><span class="hs-identifier">MimeXML</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-61"></a><span class="hs-keyword">data</span><span> </span><a name="MimePlainText"><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier">MimePlainText</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimePlainText"><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier">MimePlainText</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-62"></a><span class="hs-keyword">data</span><span> </span><a name="MimeFormUrlEncoded"><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier">MimeFormUrlEncoded</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeFormUrlEncoded"><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier">MimeFormUrlEncoded</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-63"></a><span class="hs-keyword">data</span><span> </span><a name="MimeMultipartFormData"><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier">MimeMultipartFormData</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeMultipartFormData"><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier">MimeMultipartFormData</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-64"></a><span class="hs-keyword">data</span><span> </span><a name="MimeOctetStream"><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier">MimeOctetStream</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeOctetStream"><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier">MimeOctetStream</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-65"></a><span class="hs-keyword">data</span><span> </span><a name="MimeNoContent"><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier">MimeNoContent</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeNoContent"><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier">MimeNoContent</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-66"></a><span class="hs-keyword">data</span><span> </span><a name="MimeAny"><a href="SwaggerPetstore.MimeTypes.html#MimeAny"><span class="hs-identifier">MimeAny</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeAny"><a href="SwaggerPetstore.MimeTypes.html#MimeAny"><span class="hs-identifier">MimeAny</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-67"></a><span>
|
||||
</span><a name="line-68"></a><span class="hs-keyword">data</span><span> </span><a name="MimeXmlCharsetutf8"><a href="SwaggerPetstore.MimeTypes.html#MimeXmlCharsetutf8"><span class="hs-identifier">MimeXmlCharsetutf8</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeXmlCharsetutf8"><a href="SwaggerPetstore.MimeTypes.html#MimeXmlCharsetutf8"><span class="hs-identifier">MimeXmlCharsetutf8</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-36"></a><span>
|
||||
</span><a name="line-37"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Network</span><span class="hs-operator">.</span><span class="hs-identifier">HTTP</span><span class="hs-operator">.</span><span class="hs-identifier">Media</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">ME</span><span>
|
||||
</span><a name="line-38"></a><span>
|
||||
</span><a name="line-39"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">FormUrlEncoded</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-40"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Web</span><span class="hs-operator">.</span><span class="hs-identifier">HttpApiData</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">WH</span><span>
|
||||
</span><a name="line-41"></a><span>
|
||||
</span><a name="line-42"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Data</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-43"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Proxy</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">Proxy</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-44"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-45"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">String</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-46"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Data</span><span class="hs-operator">.</span><span class="hs-identifier">Text</span><span class="hs-operator">.</span><span class="hs-identifier">Encoding</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">T</span><span>
|
||||
</span><a name="line-47"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Control</span><span class="hs-operator">.</span><span class="hs-identifier">Arrow</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">left</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-48"></a><span>
|
||||
</span><a name="line-49"></a><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Prelude</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-operator hs-var">$</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-operator hs-var">.</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-special">(</span><span class="hs-operator hs-var"><$></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-special">(</span><span class="hs-operator hs-var"><*></span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Maybe</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Bool</span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Char</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Double</span><span class="hs-special">,</span><span class="hs-identifier hs-type">FilePath</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Float</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Int</span><span class="hs-special">,</span><span class="hs-identifier hs-type">Integer</span><span class="hs-special">,</span><span class="hs-identifier hs-type">String</span><span class="hs-special">,</span><span class="hs-identifier hs-var">fmap</span><span class="hs-special">,</span><span class="hs-identifier hs-var">undefined</span><span class="hs-special">,</span><span class="hs-identifier hs-var">mempty</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-50"></a><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="hs-identifier">Prelude</span><span> </span><span class="hs-keyword">as</span><span> </span><span class="hs-identifier">P</span><span>
|
||||
</span><a name="line-51"></a><span>
|
||||
</span><a name="line-52"></a><span class="hs-comment">-- * Content Negotiation</span><span>
|
||||
</span><a name="line-53"></a><span>
|
||||
</span><a name="line-54"></a><span class="hs-comment">-- | A type for responses without content-body.</span><span>
|
||||
</span><a name="line-55"></a><span class="hs-keyword">data</span><span> </span><a name="NoContent"><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier">NoContent</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="NoContent"><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier">NoContent</span></a></a><span>
|
||||
</span><a name="line-56"></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Show</span><span class="hs-special">,</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Eq</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-57"></a><span>
|
||||
</span><a name="line-58"></a><span class="hs-comment">-- ** Mime Types</span><span>
|
||||
</span><a name="line-59"></a><span>
|
||||
</span><a name="line-60"></a><span class="hs-keyword">data</span><span> </span><a name="MimeJSON"><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier">MimeJSON</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeJSON"><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier">MimeJSON</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-61"></a><span class="hs-keyword">data</span><span> </span><a name="MimeXML"><a href="SwaggerPetstore.MimeTypes.html#MimeXML"><span class="hs-identifier">MimeXML</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeXML"><a href="SwaggerPetstore.MimeTypes.html#MimeXML"><span class="hs-identifier">MimeXML</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-62"></a><span class="hs-keyword">data</span><span> </span><a name="MimePlainText"><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier">MimePlainText</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimePlainText"><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier">MimePlainText</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-63"></a><span class="hs-keyword">data</span><span> </span><a name="MimeFormUrlEncoded"><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier">MimeFormUrlEncoded</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeFormUrlEncoded"><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier">MimeFormUrlEncoded</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-64"></a><span class="hs-keyword">data</span><span> </span><a name="MimeMultipartFormData"><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier">MimeMultipartFormData</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeMultipartFormData"><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier">MimeMultipartFormData</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-65"></a><span class="hs-keyword">data</span><span> </span><a name="MimeOctetStream"><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier">MimeOctetStream</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeOctetStream"><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier">MimeOctetStream</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-66"></a><span class="hs-keyword">data</span><span> </span><a name="MimeNoContent"><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier">MimeNoContent</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeNoContent"><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier">MimeNoContent</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-67"></a><span class="hs-keyword">data</span><span> </span><a name="MimeAny"><a href="SwaggerPetstore.MimeTypes.html#MimeAny"><span class="hs-identifier">MimeAny</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeAny"><a href="SwaggerPetstore.MimeTypes.html#MimeAny"><span class="hs-identifier">MimeAny</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-68"></a><span>
|
||||
</span><a name="line-69"></a><span class="hs-keyword">data</span><span> </span><a name="MimeJsonCharsetutf8"><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier">MimeJsonCharsetutf8</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeJsonCharsetutf8"><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier">MimeJsonCharsetutf8</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-70"></a><span>
|
||||
</span><a name="line-71"></a><span class="hs-comment">-- ** MimeType Class</span><span>
|
||||
</span><a name="line-72"></a><span>
|
||||
</span><a name="line-73"></a><span class="hs-keyword">class</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="MimeType"><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier">MimeType</span></a></a><span> </span><a name="local-6989586621679091890"><a href="#local-6989586621679091890"><span class="hs-identifier">mtype</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-74"></a><span> </span><span class="hs-pragma">{-# MINIMAL mimeType | mimeTypes #-}</span><span>
|
||||
</span><a name="line-75"></a><span>
|
||||
</span><a name="line-76"></a><span> </span><span class="hs-identifier">mimeTypes</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-77"></a><span> </span><a name="local-8214565720323866764"><a href="SwaggerPetstore.MimeTypes.html#mimeTypes"><span class="hs-identifier">mimeTypes</span></a></a><span> </span><a name="local-6989586621679092039"><a href="#local-6989586621679092039"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-78"></a><span> </span><span class="hs-keyword">case</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier hs-var">mimeType</span></a><span> </span><a href="#local-6989586621679092039"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-79"></a><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><a name="local-6989586621679092040"><a href="#local-6989586621679092040"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><a href="#local-6989586621679092040"><span class="hs-identifier hs-var">x</span></a><span class="hs-special">]</span><span>
|
||||
</span><a name="line-80"></a><span> </span><span class="hs-identifier hs-var">Nothing</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-81"></a><span>
|
||||
</span><a name="line-82"></a><span> </span><span class="hs-identifier">mimeType</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">Maybe</span><span> </span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span>
|
||||
</span><a name="line-83"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><a name="local-6989586621679092041"><a href="#local-6989586621679092041"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-84"></a><span> </span><span class="hs-keyword">case</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeTypes"><span class="hs-identifier hs-var">mimeTypes</span></a><span> </span><a href="#local-6989586621679092041"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-85"></a><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">Nothing</span><span>
|
||||
</span><a name="line-86"></a><span> </span><span class="hs-special">(</span><a name="local-6989586621679092042"><a href="#local-6989586621679092042"><span class="hs-identifier">x</span></a></a><span class="hs-glyph">:</span><span class="hs-identifier">_</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><a href="#local-6989586621679092042"><span class="hs-identifier hs-var">x</span></a><span>
|
||||
</span><a name="line-87"></a><span>
|
||||
</span><a name="line-88"></a><span> </span><span class="hs-identifier">mimeType'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">Maybe</span><span> </span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span>
|
||||
</span><a name="line-89"></a><span> </span><a name="local-8214565720323866766"><a href="SwaggerPetstore.MimeTypes.html#mimeType%27"><span class="hs-identifier">mimeType'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier hs-var">mimeType</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-90"></a><span> </span><span class="hs-identifier">mimeTypes'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-91"></a><span> </span><a name="local-8214565720323866767"><a href="SwaggerPetstore.MimeTypes.html#mimeTypes%27"><span class="hs-identifier">mimeTypes'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeTypes"><span class="hs-identifier hs-var">mimeTypes</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091890"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-92"></a><span>
|
||||
</span><a name="line-93"></a><span class="hs-comment">-- ** MimeType Instances</span><span>
|
||||
</span><a name="line-94"></a><span>
|
||||
</span><a name="line-95"></a><span class="hs-comment">-- | @application/json; charset=utf-8@</span><span>
|
||||
</span><a name="line-96"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier hs-type">MimeJSON</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-97"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/json"</span><span>
|
||||
</span><a name="line-98"></a><span class="hs-comment">-- | @application/xml; charset=utf-8@</span><span>
|
||||
</span><a name="line-99"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeXML"><span class="hs-identifier hs-type">MimeXML</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-100"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/xml"</span><span>
|
||||
</span><a name="line-101"></a><span class="hs-comment">-- | @application/x-www-form-urlencoded@</span><span>
|
||||
</span><a name="line-102"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier hs-type">MimeFormUrlEncoded</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-103"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/x-www-form-urlencoded"</span><span>
|
||||
</span><a name="line-104"></a><span class="hs-comment">-- | @multipart/form-data@</span><span>
|
||||
</span><a name="line-105"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-106"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"multipart/form-data"</span><span>
|
||||
</span><a name="line-107"></a><span class="hs-comment">-- | @text/plain; charset=utf-8@</span><span>
|
||||
</span><a name="line-108"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-109"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"text/plain"</span><span>
|
||||
</span><a name="line-110"></a><span class="hs-comment">-- | @application/octet-stream@</span><span>
|
||||
</span><a name="line-111"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-112"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/octet-stream"</span><span>
|
||||
</span><a name="line-113"></a><span class="hs-comment">-- | @"*/*"@</span><span>
|
||||
</span><a name="line-114"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeAny"><span class="hs-identifier hs-type">MimeAny</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-115"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"*/*"</span><span>
|
||||
</span><a name="line-116"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier hs-type">MimeNoContent</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-117"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Nothing</span><span>
|
||||
</span><a name="line-118"></a><span>
|
||||
</span><a name="line-119"></a><span class="hs-comment">-- | @application/xml; charset=utf-8@</span><span>
|
||||
</span><a name="line-120"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeXmlCharsetutf8"><span class="hs-identifier hs-type">MimeXmlCharsetutf8</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-121"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/xml; charset=utf-8"</span><span>
|
||||
</span><a name="line-122"></a><span>
|
||||
</span><a name="line-123"></a><span class="hs-comment">-- | @application/json; charset=utf-8@</span><span>
|
||||
</span><a name="line-124"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier hs-type">MimeJsonCharsetutf8</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-125"></a><span> </span><a name="local-8214565720323866765"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/json; charset=utf-8"</span><span>
|
||||
</span><a name="line-126"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToJSON</span><span> </span><a href="#local-6989586621679092049"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier hs-type">MimeJsonCharsetutf8</span></a><span> </span><a href="#local-6989586621679092049"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encode</span><span>
|
||||
</span><a name="line-127"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">FromJSON</span><span> </span><a href="#local-6989586621679092048"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier hs-type">MimeJsonCharsetutf8</span></a><span> </span><a href="#local-6989586621679092048"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">eitherDecode</span><span>
|
||||
</span><a name="line-128"></a><span>
|
||||
</span><a name="line-70"></a><span class="hs-keyword">data</span><span> </span><a name="MimeXmlCharsetutf8"><a href="SwaggerPetstore.MimeTypes.html#MimeXmlCharsetutf8"><span class="hs-identifier">MimeXmlCharsetutf8</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a name="MimeXmlCharsetutf8"><a href="SwaggerPetstore.MimeTypes.html#MimeXmlCharsetutf8"><span class="hs-identifier">MimeXmlCharsetutf8</span></a></a><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span class="hs-special">)</span><span>
|
||||
</span><a name="line-71"></a><span>
|
||||
</span><a name="line-72"></a><span class="hs-comment">-- ** MimeType Class</span><span>
|
||||
</span><a name="line-73"></a><span>
|
||||
</span><a name="line-74"></a><span class="hs-keyword">class</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Typeable</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="MimeType"><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier">MimeType</span></a></a><span> </span><a name="local-6989586621679096415"><a href="#local-6989586621679096415"><span class="hs-identifier">mtype</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-75"></a><span> </span><span class="hs-pragma">{-# MINIMAL mimeType | mimeTypes #-}</span><span>
|
||||
</span><a name="line-76"></a><span>
|
||||
</span><a name="line-77"></a><span> </span><span class="hs-identifier">mimeTypes</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-78"></a><span> </span><a name="local-8214565720323871289"><a href="SwaggerPetstore.MimeTypes.html#mimeTypes"><span class="hs-identifier">mimeTypes</span></a></a><span> </span><a name="local-6989586621679096564"><a href="#local-6989586621679096564"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-79"></a><span> </span><span class="hs-keyword">case</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier hs-var">mimeType</span></a><span> </span><a href="#local-6989586621679096564"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-80"></a><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><a name="local-6989586621679096565"><a href="#local-6989586621679096565"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><a href="#local-6989586621679096565"><span class="hs-identifier hs-var">x</span></a><span class="hs-special">]</span><span>
|
||||
</span><a name="line-81"></a><span> </span><span class="hs-identifier hs-var">Nothing</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-82"></a><span>
|
||||
</span><a name="line-83"></a><span> </span><span class="hs-identifier">mimeType</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">Maybe</span><span> </span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span>
|
||||
</span><a name="line-84"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><a name="local-6989586621679096566"><a href="#local-6989586621679096566"><span class="hs-identifier">p</span></a></a><span> </span><span class="hs-glyph">=</span><span>
|
||||
</span><a name="line-85"></a><span> </span><span class="hs-keyword">case</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeTypes"><span class="hs-identifier hs-var">mimeTypes</span></a><span> </span><a href="#local-6989586621679096566"><span class="hs-identifier hs-var">p</span></a><span> </span><span class="hs-keyword">of</span><span>
|
||||
</span><a name="line-86"></a><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">Nothing</span><span>
|
||||
</span><a name="line-87"></a><span> </span><span class="hs-special">(</span><a name="local-6989586621679096567"><a href="#local-6989586621679096567"><span class="hs-identifier">x</span></a></a><span class="hs-glyph">:</span><span class="hs-identifier">_</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><a href="#local-6989586621679096567"><span class="hs-identifier hs-var">x</span></a><span>
|
||||
</span><a name="line-88"></a><span>
|
||||
</span><a name="line-89"></a><span> </span><span class="hs-identifier">mimeType'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">Maybe</span><span> </span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span>
|
||||
</span><a name="line-90"></a><span> </span><a name="local-8214565720323871291"><a href="SwaggerPetstore.MimeTypes.html#mimeType%27"><span class="hs-identifier">mimeType'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier hs-var">mimeType</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-91"></a><span> </span><span class="hs-identifier">mimeTypes'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-special">[</span><span class="hs-identifier hs-type">ME</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">MediaType</span><span class="hs-special">]</span><span>
|
||||
</span><a name="line-92"></a><span> </span><a name="local-8214565720323871292"><a href="SwaggerPetstore.MimeTypes.html#mimeTypes%27"><span class="hs-identifier">mimeTypes'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeTypes"><span class="hs-identifier hs-var">mimeTypes</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096415"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span>
|
||||
</span><a name="line-93"></a><span>
|
||||
</span><a name="line-94"></a><span class="hs-comment">-- ** MimeType Instances</span><span>
|
||||
</span><a name="line-95"></a><span>
|
||||
</span><a name="line-96"></a><span class="hs-comment">-- | @application/json; charset=utf-8@</span><span>
|
||||
</span><a name="line-97"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier hs-type">MimeJSON</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-98"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/json"</span><span>
|
||||
</span><a name="line-99"></a><span class="hs-comment">-- | @application/xml; charset=utf-8@</span><span>
|
||||
</span><a name="line-100"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeXML"><span class="hs-identifier hs-type">MimeXML</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-101"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/xml"</span><span>
|
||||
</span><a name="line-102"></a><span class="hs-comment">-- | @application/x-www-form-urlencoded@</span><span>
|
||||
</span><a name="line-103"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier hs-type">MimeFormUrlEncoded</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-104"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/x-www-form-urlencoded"</span><span>
|
||||
</span><a name="line-105"></a><span class="hs-comment">-- | @multipart/form-data@</span><span>
|
||||
</span><a name="line-106"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-107"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"multipart/form-data"</span><span>
|
||||
</span><a name="line-108"></a><span class="hs-comment">-- | @text/plain; charset=utf-8@</span><span>
|
||||
</span><a name="line-109"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-110"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"text/plain"</span><span>
|
||||
</span><a name="line-111"></a><span class="hs-comment">-- | @application/octet-stream@</span><span>
|
||||
</span><a name="line-112"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-113"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/octet-stream"</span><span>
|
||||
</span><a name="line-114"></a><span class="hs-comment">-- | @"*/*"@</span><span>
|
||||
</span><a name="line-115"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeAny"><span class="hs-identifier hs-type">MimeAny</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-116"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"*/*"</span><span>
|
||||
</span><a name="line-117"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier hs-type">MimeNoContent</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-118"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Nothing</span><span>
|
||||
</span><a name="line-119"></a><span>
|
||||
</span><a name="line-120"></a><span class="hs-comment">-- | @application/json; charset=utf-8@</span><span>
|
||||
</span><a name="line-121"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier hs-type">MimeJsonCharsetutf8</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-122"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/json; charset=utf-8"</span><span>
|
||||
</span><a name="line-123"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToJSON</span><span> </span><a href="#local-6989586621679096574"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier hs-type">MimeJsonCharsetutf8</span></a><span> </span><a href="#local-6989586621679096574"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encode</span><span>
|
||||
</span><a name="line-124"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">FromJSON</span><span> </span><a href="#local-6989586621679096573"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJsonCharsetutf8"><span class="hs-identifier hs-type">MimeJsonCharsetutf8</span></a><span> </span><a href="#local-6989586621679096573"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">eitherDecode</span><span>
|
||||
</span><a name="line-125"></a><span>
|
||||
</span><a name="line-126"></a><span class="hs-comment">-- | @application/xml; charset=utf-8@</span><span>
|
||||
</span><a name="line-127"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeXmlCharsetutf8"><span class="hs-identifier hs-type">MimeXmlCharsetutf8</span></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-128"></a><span> </span><a name="local-8214565720323871290"><a href="SwaggerPetstore.MimeTypes.html#mimeType"><span class="hs-identifier">mimeType</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">Just</span><span> </span><span class="hs-operator hs-var">$</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromString</span><span> </span><span class="hs-string">"application/xml; charset=utf-8"</span><span>
|
||||
</span><a name="line-129"></a><span>
|
||||
</span><a name="line-130"></a><span class="hs-comment">-- ** MimeRender Class</span><span>
|
||||
</span><a name="line-131"></a><span>
|
||||
</span><a name="line-132"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="MimeRender"><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier">MimeRender</span></a></a><span> </span><a name="local-6989586621679091887"><a href="#local-6989586621679091887"><span class="hs-identifier">mtype</span></a></a><span> </span><a name="local-6989586621679091888"><a href="#local-6989586621679091888"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-133"></a><span> </span><span class="hs-identifier">mimeRender</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679091888"><span class="hs-identifier hs-type">x</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span>
|
||||
</span><a name="line-134"></a><span> </span><span class="hs-identifier">mimeRender'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679091888"><span class="hs-identifier hs-type">x</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span>
|
||||
</span><a name="line-135"></a><span> </span><a name="local-8214565720323866762"><a href="SwaggerPetstore.MimeTypes.html#mimeRender%27"><span class="hs-identifier">mimeRender'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><a name="local-6989586621679091889"><a href="#local-6989586621679091889"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier hs-var">mimeRender</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091887"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span> </span><a href="#local-6989586621679091889"><span class="hs-identifier hs-var">x</span></a><span>
|
||||
</span><a name="line-136"></a><span>
|
||||
</span><a name="line-130"></a><span>
|
||||
</span><a name="line-131"></a><span class="hs-comment">-- ** MimeRender Class</span><span>
|
||||
</span><a name="line-132"></a><span>
|
||||
</span><a name="line-133"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679096412"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="MimeRender"><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier">MimeRender</span></a></a><span> </span><a name="local-6989586621679096412"><a href="#local-6989586621679096412"><span class="hs-identifier">mtype</span></a></a><span> </span><a name="local-6989586621679096413"><a href="#local-6989586621679096413"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-134"></a><span> </span><span class="hs-identifier">mimeRender</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096412"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679096413"><span class="hs-identifier hs-type">x</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span>
|
||||
</span><a name="line-135"></a><span> </span><span class="hs-identifier">mimeRender'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679096412"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><a href="#local-6989586621679096413"><span class="hs-identifier hs-type">x</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span>
|
||||
</span><a name="line-136"></a><span> </span><a name="local-8214565720323871287"><a href="SwaggerPetstore.MimeTypes.html#mimeRender%27"><span class="hs-identifier">mimeRender'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><a name="local-6989586621679096414"><a href="#local-6989586621679096414"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier hs-var">mimeRender</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096412"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span> </span><a href="#local-6989586621679096414"><span class="hs-identifier hs-var">x</span></a><span>
|
||||
</span><a name="line-137"></a><span>
|
||||
</span><a name="line-138"></a><span class="hs-comment">-- ** MimeRender Instances</span><span>
|
||||
</span><a name="line-139"></a><span>
|
||||
</span><a name="line-140"></a><span class="hs-comment">-- | `A.encode`</span><span>
|
||||
</span><a name="line-141"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToJSON</span><span> </span><a href="#local-6989586621679092047"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier hs-type">MimeJSON</span></a><span> </span><a href="#local-6989586621679092047"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encode</span><span>
|
||||
</span><a name="line-142"></a><span class="hs-comment">-- | @WH.urlEncodeAsForm@</span><span>
|
||||
</span><a name="line-143"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">WH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToForm</span><span> </span><a href="#local-6989586621679092046"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier hs-type">MimeFormUrlEncoded</span></a><span> </span><a href="#local-6989586621679092046"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">urlEncodeAsForm</span><span>
|
||||
</span><a name="line-144"></a><span>
|
||||
</span><a name="line-145"></a><span class="hs-comment">-- | @P.id@</span><span>
|
||||
</span><a name="line-146"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-147"></a><span class="hs-comment">-- | @BL.fromStrict . T.encodeUtf8@</span><span>
|
||||
</span><a name="line-148"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromStrict</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encodeUtf8</span><span>
|
||||
</span><a name="line-149"></a><span class="hs-comment">-- | @BCL.pack@</span><span>
|
||||
</span><a name="line-150"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span>
|
||||
</span><a name="line-151"></a><span>
|
||||
</span><a name="line-152"></a><span class="hs-comment">-- | @P.id@</span><span>
|
||||
</span><a name="line-153"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-154"></a><span class="hs-comment">-- | @BL.fromStrict . T.encodeUtf8@</span><span>
|
||||
</span><a name="line-155"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromStrict</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encodeUtf8</span><span>
|
||||
</span><a name="line-156"></a><span class="hs-comment">-- | @BCL.pack@</span><span>
|
||||
</span><a name="line-157"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span>
|
||||
</span><a name="line-158"></a><span>
|
||||
</span><a name="line-159"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-160"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#Binary"><span class="hs-identifier hs-type">Binary</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">unBinary</span><span>
|
||||
</span><a name="line-161"></a><span>
|
||||
</span><a name="line-162"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#ByteArray"><span class="hs-identifier hs-type">ByteArray</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-163"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Bool</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-164"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Char</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-165"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#Date"><span class="hs-identifier hs-type">Date</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-166"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#DateTime"><span class="hs-identifier hs-type">DateTime</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-167"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Double</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-168"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Float</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-169"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Int</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-170"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Integer</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-171"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-172"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-173"></a><span>
|
||||
</span><a name="line-174"></a><span class="hs-identifier">mimeRenderDefaultMultipartFormData</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">WH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToHttpApiData</span><span> </span><a href="#local-6989586621679092043"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="#local-6989586621679092043"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span>
|
||||
</span><a name="line-175"></a><a name="mimeRenderDefaultMultipartFormData"><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier">mimeRenderDefaultMultipartFormData</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromStrict</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encodeUtf8</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toQueryParam</span><span>
|
||||
</span><a name="line-176"></a><span>
|
||||
</span><a name="line-177"></a><span class="hs-comment">-- | @P.Right . P.const NoContent@</span><span>
|
||||
</span><a name="line-178"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier hs-type">MimeNoContent</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier hs-type">NoContent</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866761"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">const</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">empty</span><span>
|
||||
</span><a name="line-179"></a><span>
|
||||
</span><a name="line-180"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec</span><span>
|
||||
</span><a name="line-181"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec</span><span>
|
||||
</span><a name="line-182"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec</span><span>
|
||||
</span><a name="line-183"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec</span><span>
|
||||
</span><a name="line-184"></a><span>
|
||||
</span><a name="line-185"></a><span class="hs-comment">-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined</span><span>
|
||||
</span><a name="line-138"></a><span>
|
||||
</span><a name="line-139"></a><span class="hs-comment">-- ** MimeRender Instances</span><span>
|
||||
</span><a name="line-140"></a><span>
|
||||
</span><a name="line-141"></a><span class="hs-comment">-- | `A.encode`</span><span>
|
||||
</span><a name="line-142"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToJSON</span><span> </span><a href="#local-6989586621679096572"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier hs-type">MimeJSON</span></a><span> </span><a href="#local-6989586621679096572"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encode</span><span>
|
||||
</span><a name="line-143"></a><span class="hs-comment">-- | @WH.urlEncodeAsForm@</span><span>
|
||||
</span><a name="line-144"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">WH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToForm</span><span> </span><a href="#local-6989586621679096571"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier hs-type">MimeFormUrlEncoded</span></a><span> </span><a href="#local-6989586621679096571"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">urlEncodeAsForm</span><span>
|
||||
</span><a name="line-145"></a><span>
|
||||
</span><a name="line-146"></a><span class="hs-comment">-- | @P.id@</span><span>
|
||||
</span><a name="line-147"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-148"></a><span class="hs-comment">-- | @BL.fromStrict . T.encodeUtf8@</span><span>
|
||||
</span><a name="line-149"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromStrict</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encodeUtf8</span><span>
|
||||
</span><a name="line-150"></a><span class="hs-comment">-- | @BCL.pack@</span><span>
|
||||
</span><a name="line-151"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span>
|
||||
</span><a name="line-152"></a><span>
|
||||
</span><a name="line-153"></a><span class="hs-comment">-- | @P.id@</span><span>
|
||||
</span><a name="line-154"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-155"></a><span class="hs-comment">-- | @BL.fromStrict . T.encodeUtf8@</span><span>
|
||||
</span><a name="line-156"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromStrict</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encodeUtf8</span><span>
|
||||
</span><a name="line-157"></a><span class="hs-comment">-- | @BCL.pack@</span><span>
|
||||
</span><a name="line-158"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">pack</span><span>
|
||||
</span><a name="line-159"></a><span>
|
||||
</span><a name="line-160"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-161"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#Binary"><span class="hs-identifier hs-type">Binary</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">unBinary</span><span>
|
||||
</span><a name="line-162"></a><span>
|
||||
</span><a name="line-163"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#ByteArray"><span class="hs-identifier hs-type">ByteArray</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-164"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Bool</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-165"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Char</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-166"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#Date"><span class="hs-identifier hs-type">Date</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-167"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><a href="SwaggerPetstore.Model.html#DateTime"><span class="hs-identifier hs-type">DateTime</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-168"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Double</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-169"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Float</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-170"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Int</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-171"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">Integer</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-172"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-173"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeMultipartFormData"><span class="hs-identifier hs-type">MimeMultipartFormData</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier hs-var">mimeRenderDefaultMultipartFormData</span></a><span>
|
||||
</span><a name="line-174"></a><span>
|
||||
</span><a name="line-175"></a><span class="hs-identifier">mimeRenderDefaultMultipartFormData</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">WH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ToHttpApiData</span><span> </span><a href="#local-6989586621679096568"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="#local-6989586621679096568"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span>
|
||||
</span><a name="line-176"></a><a name="mimeRenderDefaultMultipartFormData"><a href="SwaggerPetstore.MimeTypes.html#mimeRenderDefaultMultipartFormData"><span class="hs-identifier">mimeRenderDefaultMultipartFormData</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">fromStrict</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">encodeUtf8</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toQueryParam</span><span>
|
||||
</span><a name="line-177"></a><span>
|
||||
</span><a name="line-178"></a><span class="hs-comment">-- | @P.Right . P.const NoContent@</span><span>
|
||||
</span><a name="line-179"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeRender"><span class="hs-identifier hs-type">MimeRender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier hs-type">MimeNoContent</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier hs-type">NoContent</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871286"><a href="SwaggerPetstore.MimeTypes.html#mimeRender"><span class="hs-identifier">mimeRender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">const</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">empty</span><span>
|
||||
</span><a name="line-180"></a><span>
|
||||
</span><a name="line-181"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Double where mimeRender _ = BB.toLazyByteString . BB.doubleDec</span><span>
|
||||
</span><a name="line-182"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Float where mimeRender _ = BB.toLazyByteString . BB.floatDec</span><span>
|
||||
</span><a name="line-183"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec</span><span>
|
||||
</span><a name="line-184"></a><span class="hs-comment">-- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec</span><span>
|
||||
</span><a name="line-185"></a><span>
|
||||
</span><a name="line-186"></a><span class="hs-comment">-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined</span><span>
|
||||
</span><a name="line-187"></a><span>
|
||||
</span><a name="line-188"></a><span class="hs-comment">-- ** MimeUnrender Class</span><span>
|
||||
</span><a name="line-189"></a><span>
|
||||
</span><a name="line-190"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679091884"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="MimeUnrender"><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier">MimeUnrender</span></a></a><span> </span><a name="local-6989586621679091884"><a href="#local-6989586621679091884"><span class="hs-identifier">mtype</span></a></a><span> </span><a name="local-6989586621679091885"><a href="#local-6989586621679091885"><span class="hs-identifier">o</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-191"></a><span> </span><span class="hs-identifier">mimeUnrender</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091884"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Either</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><a href="#local-6989586621679091885"><span class="hs-identifier hs-type">o</span></a><span>
|
||||
</span><a name="line-192"></a><span> </span><span class="hs-identifier">mimeUnrender'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679091884"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Either</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><a href="#local-6989586621679091885"><span class="hs-identifier hs-type">o</span></a><span>
|
||||
</span><a name="line-193"></a><span> </span><a name="local-8214565720323866759"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender%27"><span class="hs-identifier">mimeUnrender'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><a name="local-6989586621679091886"><a href="#local-6989586621679091886"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier hs-var">mimeUnrender</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679091884"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span> </span><a href="#local-6989586621679091886"><span class="hs-identifier hs-var">x</span></a><span>
|
||||
</span><a name="line-194"></a><span>
|
||||
</span><a name="line-195"></a><span class="hs-comment">-- ** MimeUnrender Instances</span><span>
|
||||
</span><a name="line-196"></a><span>
|
||||
</span><a name="line-197"></a><span class="hs-comment">-- | @A.eitherDecode@</span><span>
|
||||
</span><a name="line-198"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">FromJSON</span><span> </span><a href="#local-6989586621679092045"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier hs-type">MimeJSON</span></a><span> </span><a href="#local-6989586621679092045"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">eitherDecode</span><span>
|
||||
</span><a name="line-199"></a><span class="hs-comment">-- | @P.left T.unpack . WH.urlDecodeAsForm@</span><span>
|
||||
</span><a name="line-200"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">WH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">FromForm</span><span> </span><a href="#local-6989586621679092044"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier hs-type">MimeFormUrlEncoded</span></a><span> </span><a href="#local-6989586621679092044"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">left</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">urlDecodeAsForm</span><span>
|
||||
</span><a name="line-201"></a><span class="hs-comment">-- | @P.Right . P.id@</span><span>
|
||||
</span><a name="line-202"></a><span>
|
||||
</span><a name="line-203"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-204"></a><span class="hs-comment">-- | @P.left P.show . TL.decodeUtf8'@</span><span>
|
||||
</span><a name="line-205"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">left</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">decodeUtf8'</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toStrict</span><span>
|
||||
</span><a name="line-206"></a><span class="hs-comment">-- | @P.Right . BCL.unpack@</span><span>
|
||||
</span><a name="line-207"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span>
|
||||
</span><a name="line-208"></a><span>
|
||||
</span><a name="line-209"></a><span class="hs-comment">-- | @P.Right . P.id@</span><span>
|
||||
</span><a name="line-210"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-211"></a><span class="hs-comment">-- | @P.left P.show . T.decodeUtf8' . BL.toStrict@</span><span>
|
||||
</span><a name="line-212"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">left</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">decodeUtf8'</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toStrict</span><span>
|
||||
</span><a name="line-213"></a><span class="hs-comment">-- | @P.Right . BCL.unpack@</span><span>
|
||||
</span><a name="line-214"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span>
|
||||
</span><a name="line-215"></a><span>
|
||||
</span><a name="line-216"></a><span class="hs-comment">-- | @P.Right . P.const NoContent@</span><span>
|
||||
</span><a name="line-217"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier hs-type">MimeNoContent</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier hs-type">NoContent</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323866758"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">const</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier hs-var">NoContent</span></a><span>
|
||||
</span><a name="line-218"></a><span>
|
||||
</span><a name="line-219"></a><span class="hs-comment">-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined</span><span>
|
||||
</span><a name="line-187"></a><span class="hs-comment">-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined</span><span>
|
||||
</span><a name="line-188"></a><span>
|
||||
</span><a name="line-189"></a><span class="hs-comment">-- ** MimeUnrender Class</span><span>
|
||||
</span><a name="line-190"></a><span>
|
||||
</span><a name="line-191"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679096409"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="MimeUnrender"><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier">MimeUnrender</span></a></a><span> </span><a name="local-6989586621679096409"><a href="#local-6989586621679096409"><span class="hs-identifier">mtype</span></a></a><span> </span><a name="local-6989586621679096410"><a href="#local-6989586621679096410"><span class="hs-identifier">o</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-192"></a><span> </span><span class="hs-identifier">mimeUnrender</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096409"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Either</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><a href="#local-6989586621679096410"><span class="hs-identifier hs-type">o</span></a><span>
|
||||
</span><a name="line-193"></a><span> </span><span class="hs-identifier">mimeUnrender'</span><span> </span><span class="hs-glyph">::</span><span> </span><a href="#local-6989586621679096409"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-glyph">-></span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Either</span><span> </span><span class="hs-identifier hs-type">String</span><span> </span><a href="#local-6989586621679096410"><span class="hs-identifier hs-type">o</span></a><span>
|
||||
</span><a name="line-194"></a><span> </span><a name="local-8214565720323871284"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender%27"><span class="hs-identifier">mimeUnrender'</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><a name="local-6989586621679096411"><a href="#local-6989586621679096411"><span class="hs-identifier">x</span></a></a><span> </span><span class="hs-glyph">=</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier hs-var">mimeUnrender</span></a><span> </span><span class="hs-special">(</span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Proxy</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier hs-type">P</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Proxy</span><span> </span><a href="#local-6989586621679096409"><span class="hs-identifier hs-type">mtype</span></a><span class="hs-special">)</span><span> </span><a href="#local-6989586621679096411"><span class="hs-identifier hs-var">x</span></a><span>
|
||||
</span><a name="line-195"></a><span>
|
||||
</span><a name="line-196"></a><span class="hs-comment">-- ** MimeUnrender Instances</span><span>
|
||||
</span><a name="line-197"></a><span>
|
||||
</span><a name="line-198"></a><span class="hs-comment">-- | @A.eitherDecode@</span><span>
|
||||
</span><a name="line-199"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">A</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">FromJSON</span><span> </span><a href="#local-6989586621679096570"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeJSON"><span class="hs-identifier hs-type">MimeJSON</span></a><span> </span><a href="#local-6989586621679096570"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">A</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">eitherDecode</span><span>
|
||||
</span><a name="line-200"></a><span class="hs-comment">-- | @P.left T.unpack . WH.urlDecodeAsForm@</span><span>
|
||||
</span><a name="line-201"></a><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier hs-type">WH</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">FromForm</span><span> </span><a href="#local-6989586621679096569"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeFormUrlEncoded"><span class="hs-identifier hs-type">MimeFormUrlEncoded</span></a><span> </span><a href="#local-6989586621679096569"><span class="hs-identifier hs-type">a</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">left</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">WH</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">urlDecodeAsForm</span><span>
|
||||
</span><a name="line-202"></a><span class="hs-comment">-- | @P.Right . P.id@</span><span>
|
||||
</span><a name="line-203"></a><span>
|
||||
</span><a name="line-204"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-205"></a><span class="hs-comment">-- | @P.left P.show . TL.decodeUtf8'@</span><span>
|
||||
</span><a name="line-206"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">left</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">decodeUtf8'</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toStrict</span><span>
|
||||
</span><a name="line-207"></a><span class="hs-comment">-- | @P.Right . BCL.unpack@</span><span>
|
||||
</span><a name="line-208"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimePlainText"><span class="hs-identifier hs-type">MimePlainText</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span>
|
||||
</span><a name="line-209"></a><span>
|
||||
</span><a name="line-210"></a><span class="hs-comment">-- | @P.Right . P.id@</span><span>
|
||||
</span><a name="line-211"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">BL</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">ByteString</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">id</span><span>
|
||||
</span><a name="line-212"></a><span class="hs-comment">-- | @P.left P.show . T.decodeUtf8' . BL.toStrict@</span><span>
|
||||
</span><a name="line-213"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">T</span><span class="hs-operator hs-type">.</span><span class="hs-identifier hs-type">Text</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">left</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">show</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">T</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">decodeUtf8'</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">toStrict</span><span>
|
||||
</span><a name="line-214"></a><span class="hs-comment">-- | @P.Right . BCL.unpack@</span><span>
|
||||
</span><a name="line-215"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeOctetStream"><span class="hs-identifier hs-type">MimeOctetStream</span></a><span> </span><span class="hs-identifier hs-type">String</span><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">BCL</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">unpack</span><span>
|
||||
</span><a name="line-216"></a><span>
|
||||
</span><a name="line-217"></a><span class="hs-comment">-- | @P.Right . P.const NoContent@</span><span>
|
||||
</span><a name="line-218"></a><span class="hs-keyword">instance</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeUnrender"><span class="hs-identifier hs-type">MimeUnrender</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeNoContent"><span class="hs-identifier hs-type">MimeNoContent</span></a><span> </span><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier hs-type">NoContent</span></a><span> </span><span class="hs-keyword">where</span><span> </span><a name="local-8214565720323871283"><a href="SwaggerPetstore.MimeTypes.html#mimeUnrender"><span class="hs-identifier">mimeUnrender</span></a></a><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">Right</span><span> </span><span class="hs-operator hs-var">.</span><span> </span><span class="hs-identifier hs-var">P</span><span class="hs-operator hs-var">.</span><span class="hs-identifier hs-var">const</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#NoContent"><span class="hs-identifier hs-var">NoContent</span></a><span>
|
||||
</span><a name="line-219"></a><span>
|
||||
</span><a name="line-220"></a><span class="hs-comment">-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined</span><span>
|
||||
</span><a name="line-221"></a><span>
|
||||
</span><a name="line-222"></a><span class="hs-comment">-- ** Request Consumes</span><span>
|
||||
</span><a name="line-223"></a><span>
|
||||
</span><a name="line-224"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679091883"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="Consumes"><a href="SwaggerPetstore.MimeTypes.html#Consumes"><span class="hs-identifier">Consumes</span></a></a><span> </span><a name="local-6989586621679091882"><a href="#local-6989586621679091882"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679091883"><a href="#local-6989586621679091883"><span class="hs-identifier">mtype</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-225"></a><span>
|
||||
</span><a name="line-226"></a><span class="hs-comment">-- ** Request Produces</span><span>
|
||||
</span><a name="line-227"></a><span>
|
||||
</span><a name="line-228"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679091881"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="Produces"><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier">Produces</span></a></a><span> </span><a name="local-6989586621679091880"><a href="#local-6989586621679091880"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679091881"><a href="#local-6989586621679091881"><span class="hs-identifier">mtype</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-229"></a></pre></body></html>
|
||||
</span><a name="line-221"></a><span class="hs-comment">-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined</span><span>
|
||||
</span><a name="line-222"></a><span>
|
||||
</span><a name="line-223"></a><span class="hs-comment">-- ** Request Consumes</span><span>
|
||||
</span><a name="line-224"></a><span>
|
||||
</span><a name="line-225"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679096408"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="Consumes"><a href="SwaggerPetstore.MimeTypes.html#Consumes"><span class="hs-identifier">Consumes</span></a></a><span> </span><a name="local-6989586621679096407"><a href="#local-6989586621679096407"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679096408"><a href="#local-6989586621679096408"><span class="hs-identifier">mtype</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-226"></a><span>
|
||||
</span><a name="line-227"></a><span class="hs-comment">-- ** Request Produces</span><span>
|
||||
</span><a name="line-228"></a><span>
|
||||
</span><a name="line-229"></a><span class="hs-keyword">class</span><span> </span><a href="SwaggerPetstore.MimeTypes.html#MimeType"><span class="hs-identifier hs-type">MimeType</span></a><span> </span><a href="#local-6989586621679096406"><span class="hs-identifier hs-type">mtype</span></a><span> </span><span class="hs-glyph">=></span><span> </span><a name="Produces"><a href="SwaggerPetstore.MimeTypes.html#Produces"><span class="hs-identifier">Produces</span></a></a><span> </span><a name="local-6989586621679096405"><a href="#local-6989586621679096405"><span class="hs-identifier">req</span></a></a><span> </span><a name="local-6989586621679096406"><a href="#local-6989586621679096406"><span class="hs-identifier">mtype</span></a></a><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-230"></a></pre></body></html>
|
File diff suppressed because it is too large
Load Diff
@ -3,28 +3,29 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}</span><span>
|
||||
</span><a name="line-10"></a><span>
|
||||
</span><a name="line-11"></a><span class="hs-comment">{-|
|
||||
</span><a name="line-11"></a><span>
|
||||
</span><a name="line-12"></a><span class="hs-comment">{-|
|
||||
Module : SwaggerPetstore
|
||||
-}</span><span>
|
||||
</span><a name="line-14"></a><span>
|
||||
</span><a name="line-15"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span>
|
||||
</span><a name="line-16"></a><span> </span><span class="hs-special">(</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span>
|
||||
</span><a name="line-17"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">API</span><span>
|
||||
</span><a name="line-18"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span><span>
|
||||
</span><a name="line-19"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span><span>
|
||||
</span><a name="line-20"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Lens</span><span>
|
||||
</span><a name="line-21"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span><span>
|
||||
</span><a name="line-22"></a><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-23"></a><span>
|
||||
</span><a name="line-24"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.API.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">API</span></a><span>
|
||||
</span><a name="line-25"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Client.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span></a><span>
|
||||
</span><a name="line-26"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Model.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span></a><span>
|
||||
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.MimeTypes.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span></a><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Lens.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Lens</span></a><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Logging.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span></a><span>
|
||||
</span><a name="line-30"></a></pre></body></html>
|
||||
</span><a name="line-15"></a><span>
|
||||
</span><a name="line-16"></a><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span>
|
||||
</span><a name="line-17"></a><span> </span><span class="hs-special">(</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span><span>
|
||||
</span><a name="line-18"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">API</span><span>
|
||||
</span><a name="line-19"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span><span>
|
||||
</span><a name="line-20"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span><span>
|
||||
</span><a name="line-21"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Lens</span><span>
|
||||
</span><a name="line-22"></a><span> </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span><span>
|
||||
</span><a name="line-23"></a><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
|
||||
</span><a name="line-24"></a><span>
|
||||
</span><a name="line-25"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.API.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">API</span></a><span>
|
||||
</span><a name="line-26"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Client.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Client</span></a><span>
|
||||
</span><a name="line-27"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Model.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Model</span></a><span>
|
||||
</span><a name="line-28"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.MimeTypes.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">MimeTypes</span></a><span>
|
||||
</span><a name="line-29"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Lens.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Lens</span></a><span>
|
||||
</span><a name="line-30"></a><span class="hs-keyword">import</span><span> </span><a href="SwaggerPetstore.Logging.html"><span class="hs-identifier">SwaggerPetstore</span><span class="hs-operator">.</span><span class="hs-identifier">Logging</span></a><span>
|
||||
</span><a name="line-31"></a></pre></body></html>
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
@ -233,11 +234,11 @@ testEndpointParameters
|
||||
-> SwaggerPetstoreRequest TestEndpointParameters contentType res
|
||||
testEndpointParameters _ (Number number) (ParamDouble double) (PatternWithoutDelimiter patternWithoutDelimiter) (Byte byte) =
|
||||
_mkRequest "POST" ["/fake"]
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest)
|
||||
`addForm` toForm ("number", number)
|
||||
`addForm` toForm ("double", double)
|
||||
`addForm` toForm ("pattern_without_delimiter", patternWithoutDelimiter)
|
||||
`addForm` toForm ("byte", byte)
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthBasicHttpBasicTest)
|
||||
|
||||
data TestEndpointParameters
|
||||
|
||||
@ -410,8 +411,8 @@ testClassname
|
||||
-> SwaggerPetstoreRequest TestClassname contentType Client
|
||||
testClassname _ body =
|
||||
_mkRequest "PATCH" ["/fake_classname_test"]
|
||||
`setBodyParam` body
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKeyQuery)
|
||||
`setBodyParam` body
|
||||
|
||||
data TestClassname
|
||||
|
||||
@ -446,8 +447,8 @@ addPet
|
||||
-> SwaggerPetstoreRequest AddPet contentType res
|
||||
addPet _ body =
|
||||
_mkRequest "POST" ["/pet"]
|
||||
`setBodyParam` body
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setBodyParam` body
|
||||
|
||||
data AddPet
|
||||
|
||||
@ -482,7 +483,6 @@ deletePet
|
||||
-> SwaggerPetstoreRequest DeletePet MimeNoContent res
|
||||
deletePet (PetId petId) =
|
||||
_mkRequest "DELETE" ["/pet/",toPath petId]
|
||||
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
|
||||
data DeletePet
|
||||
@ -510,8 +510,8 @@ findPetsByStatus
|
||||
-> SwaggerPetstoreRequest FindPetsByStatus MimeNoContent [Pet]
|
||||
findPetsByStatus (Status status) =
|
||||
_mkRequest "GET" ["/pet/findByStatus"]
|
||||
`setQuery` toQueryColl CommaSeparated ("status", Just status)
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setQuery` toQueryColl CommaSeparated ("status", Just status)
|
||||
|
||||
data FindPetsByStatus
|
||||
-- | @application/xml@
|
||||
@ -535,8 +535,8 @@ findPetsByTags
|
||||
-> SwaggerPetstoreRequest FindPetsByTags MimeNoContent [Pet]
|
||||
findPetsByTags (Tags tags) =
|
||||
_mkRequest "GET" ["/pet/findByTags"]
|
||||
`setQuery` toQueryColl CommaSeparated ("tags", Just tags)
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setQuery` toQueryColl CommaSeparated ("tags", Just tags)
|
||||
|
||||
{-# DEPRECATED findPetsByTags "" #-}
|
||||
|
||||
@ -562,7 +562,6 @@ getPetById
|
||||
-> SwaggerPetstoreRequest GetPetById MimeNoContent Pet
|
||||
getPetById (PetId petId) =
|
||||
_mkRequest "GET" ["/pet/",toPath petId]
|
||||
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyApiKey)
|
||||
|
||||
data GetPetById
|
||||
@ -591,8 +590,8 @@ updatePet
|
||||
-> SwaggerPetstoreRequest UpdatePet contentType res
|
||||
updatePet _ body =
|
||||
_mkRequest "PUT" ["/pet"]
|
||||
`setBodyParam` body
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
`setBodyParam` body
|
||||
|
||||
data UpdatePet
|
||||
|
||||
@ -629,7 +628,6 @@ updatePetWithForm
|
||||
-> SwaggerPetstoreRequest UpdatePetWithForm contentType res
|
||||
updatePetWithForm _ (PetId petId) =
|
||||
_mkRequest "POST" ["/pet/",toPath petId]
|
||||
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
|
||||
data UpdatePetWithForm
|
||||
@ -670,7 +668,6 @@ uploadFile
|
||||
-> SwaggerPetstoreRequest UploadFile contentType ApiResponse
|
||||
uploadFile _ (PetId petId) =
|
||||
_mkRequest "POST" ["/pet/",toPath petId,"/uploadImage"]
|
||||
|
||||
`_hasAuthType` (P.Proxy :: P.Proxy AuthOAuthPetstoreAuth)
|
||||
|
||||
data UploadFile
|
||||
@ -709,7 +706,6 @@ deleteOrder
|
||||
-> SwaggerPetstoreRequest DeleteOrder MimeNoContent res
|
||||
deleteOrder (OrderIdText orderId) =
|
||||
_mkRequest "DELETE" ["/store/order/",toPath orderId]
|
||||
|
||||
|
||||
data DeleteOrder
|
||||
-- | @application/xml@
|
||||
@ -752,7 +748,6 @@ getOrderById
|
||||
-> SwaggerPetstoreRequest GetOrderById MimeNoContent Order
|
||||
getOrderById (OrderId orderId) =
|
||||
_mkRequest "GET" ["/store/order/",toPath orderId]
|
||||
|
||||
|
||||
data GetOrderById
|
||||
-- | @application/xml@
|
||||
@ -892,7 +887,6 @@ deleteUser
|
||||
-> SwaggerPetstoreRequest DeleteUser MimeNoContent res
|
||||
deleteUser (Username username) =
|
||||
_mkRequest "DELETE" ["/user/",toPath username]
|
||||
|
||||
|
||||
data DeleteUser
|
||||
-- | @application/xml@
|
||||
@ -914,7 +908,6 @@ getUserByName
|
||||
-> SwaggerPetstoreRequest GetUserByName MimeNoContent User
|
||||
getUserByName (Username username) =
|
||||
_mkRequest "GET" ["/user/",toPath username]
|
||||
|
||||
|
||||
data GetUserByName
|
||||
-- | @application/xml@
|
||||
@ -987,7 +980,6 @@ updateUser
|
||||
-> SwaggerPetstoreRequest UpdateUser contentType res
|
||||
updateUser _ (Username username) body =
|
||||
_mkRequest "PUT" ["/user/",toPath username]
|
||||
|
||||
`setBodyParam` body
|
||||
|
||||
data UpdateUser
|
||||
@ -1027,81 +1019,6 @@ class HasOptionalParam req param where
|
||||
|
||||
infixl 2 -&-
|
||||
|
||||
-- * Request Parameter Types
|
||||
|
||||
-- | ApiKey
|
||||
newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
|
||||
-- | StatusText
|
||||
newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show)
|
||||
-- | ParamString
|
||||
newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
|
||||
-- | ParamInteger
|
||||
newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show)
|
||||
-- | EnumQueryDouble
|
||||
newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show)
|
||||
-- | Number
|
||||
newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show)
|
||||
-- | Int32
|
||||
newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show)
|
||||
-- | ParamDate
|
||||
newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
|
||||
-- | EnumFormString
|
||||
newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Body
|
||||
newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
-- | Tags
|
||||
newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
|
||||
-- | EnumQueryInteger
|
||||
newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show)
|
||||
-- | ParamFloat
|
||||
newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show)
|
||||
-- | Name2
|
||||
newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Password
|
||||
newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Status
|
||||
newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show)
|
||||
-- | ParamDouble
|
||||
newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show)
|
||||
-- | EnumHeaderString
|
||||
newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Param2
|
||||
newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show)
|
||||
-- | PetId
|
||||
newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
|
||||
-- | OrderId
|
||||
newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show)
|
||||
-- | OrderIdText
|
||||
newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show)
|
||||
-- | EnumQueryString
|
||||
newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show)
|
||||
-- | ParamDateTime
|
||||
newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show)
|
||||
-- | EnumQueryStringArray
|
||||
newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show)
|
||||
-- | PatternWithoutDelimiter
|
||||
newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Callback
|
||||
newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Username
|
||||
newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Int64
|
||||
newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show)
|
||||
-- | AdditionalMetadata
|
||||
newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show)
|
||||
-- | Byte
|
||||
newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
|
||||
-- | ParamBinary
|
||||
newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
|
||||
-- | EnumFormStringArray
|
||||
newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show)
|
||||
-- | EnumHeaderStringArray
|
||||
newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show)
|
||||
-- | Param
|
||||
newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show)
|
||||
-- | File
|
||||
newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
|
||||
|
||||
-- * SwaggerPetstoreRequest
|
||||
|
||||
-- | Represents a request. The "req" type variable is the request type. The "res" type variable is the response type.
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
@ -65,8 +66,8 @@ data MimeOctetStream = MimeOctetStream deriving (P.Typeable)
|
||||
data MimeNoContent = MimeNoContent deriving (P.Typeable)
|
||||
data MimeAny = MimeAny deriving (P.Typeable)
|
||||
|
||||
data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
|
||||
data MimeJsonCharsetutf8 = MimeJsonCharsetutf8 deriving (P.Typeable)
|
||||
data MimeXmlCharsetutf8 = MimeXmlCharsetutf8 deriving (P.Typeable)
|
||||
|
||||
-- ** MimeType Class
|
||||
|
||||
@ -116,16 +117,16 @@ instance MimeType MimeAny where
|
||||
instance MimeType MimeNoContent where
|
||||
mimeType _ = Nothing
|
||||
|
||||
-- | @application/xml; charset=utf-8@
|
||||
instance MimeType MimeXmlCharsetutf8 where
|
||||
mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
|
||||
|
||||
-- | @application/json; charset=utf-8@
|
||||
instance MimeType MimeJsonCharsetutf8 where
|
||||
mimeType _ = Just $ P.fromString "application/json; charset=utf-8"
|
||||
instance A.ToJSON a => MimeRender MimeJsonCharsetutf8 a where mimeRender _ = A.encode
|
||||
instance A.FromJSON a => MimeUnrender MimeJsonCharsetutf8 a where mimeUnrender _ = A.eitherDecode
|
||||
|
||||
-- | @application/xml; charset=utf-8@
|
||||
instance MimeType MimeXmlCharsetutf8 where
|
||||
mimeType _ = Just $ P.fromString "application/xml; charset=utf-8"
|
||||
|
||||
|
||||
-- ** MimeRender Class
|
||||
|
||||
@ -182,8 +183,8 @@ instance MimeRender MimeNoContent NoContent where mimeRender _ = P.const BCL.emp
|
||||
-- instance MimeRender MimeOctetStream Int where mimeRender _ = BB.toLazyByteString . BB.intDec
|
||||
-- instance MimeRender MimeOctetStream Integer where mimeRender _ = BB.toLazyByteString . BB.integerDec
|
||||
|
||||
-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
|
||||
-- instance MimeRender MimeJsonCharsetutf8 T.Text where mimeRender _ = undefined
|
||||
-- instance MimeRender MimeXmlCharsetutf8 T.Text where mimeRender _ = undefined
|
||||
|
||||
-- ** MimeUnrender Class
|
||||
|
||||
@ -216,8 +217,8 @@ instance MimeUnrender MimeOctetStream String where mimeUnrender _ = P.Right . BC
|
||||
-- | @P.Right . P.const NoContent@
|
||||
instance MimeUnrender MimeNoContent NoContent where mimeUnrender _ = P.Right . P.const NoContent
|
||||
|
||||
-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined
|
||||
-- instance MimeUnrender MimeJsonCharsetutf8 T.Text where mimeUnrender _ = undefined
|
||||
-- instance MimeUnrender MimeXmlCharsetutf8 T.Text where mimeUnrender _ = undefined
|
||||
|
||||
-- ** Request Consumes
|
||||
|
||||
|
@ -3,7 +3,8 @@
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
|
||||
OpenAPI spec version: 1.0.0
|
||||
OpenAPI spec version: 2.0
|
||||
Swagger Petstore API version: 1.0.0
|
||||
Contact: apiteam@swagger.io
|
||||
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
-}
|
||||
@ -1398,6 +1399,45 @@ mkDog dogClassName =
|
||||
}
|
||||
|
||||
|
||||
-- * Parameter newtypes
|
||||
|
||||
newtype AdditionalMetadata = AdditionalMetadata { unAdditionalMetadata :: Text } deriving (P.Eq, P.Show)
|
||||
newtype ApiKey = ApiKey { unApiKey :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Body = Body { unBody :: [User] } deriving (P.Eq, P.Show, A.ToJSON)
|
||||
newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
|
||||
newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
|
||||
newtype EnumFormString = EnumFormString { unEnumFormString :: Text } deriving (P.Eq, P.Show)
|
||||
newtype EnumFormStringArray = EnumFormStringArray { unEnumFormStringArray :: [Text] } deriving (P.Eq, P.Show)
|
||||
newtype EnumHeaderString = EnumHeaderString { unEnumHeaderString :: Text } deriving (P.Eq, P.Show)
|
||||
newtype EnumHeaderStringArray = EnumHeaderStringArray { unEnumHeaderStringArray :: [Text] } deriving (P.Eq, P.Show)
|
||||
newtype EnumQueryDouble = EnumQueryDouble { unEnumQueryDouble :: Double } deriving (P.Eq, P.Show)
|
||||
newtype EnumQueryInteger = EnumQueryInteger { unEnumQueryInteger :: Int } deriving (P.Eq, P.Show)
|
||||
newtype EnumQueryString = EnumQueryString { unEnumQueryString :: Text } deriving (P.Eq, P.Show)
|
||||
newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray :: [Text] } deriving (P.Eq, P.Show)
|
||||
newtype File = File { unFile :: FilePath } deriving (P.Eq, P.Show)
|
||||
newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show)
|
||||
newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show)
|
||||
newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Number = Number { unNumber :: Double } deriving (P.Eq, P.Show)
|
||||
newtype OrderId = OrderId { unOrderId :: Integer } deriving (P.Eq, P.Show)
|
||||
newtype OrderIdText = OrderIdText { unOrderIdText :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Param = Param { unParam :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Param2 = Param2 { unParam2 :: Text } deriving (P.Eq, P.Show)
|
||||
newtype ParamBinary = ParamBinary { unParamBinary :: Binary } deriving (P.Eq, P.Show)
|
||||
newtype ParamDate = ParamDate { unParamDate :: Date } deriving (P.Eq, P.Show)
|
||||
newtype ParamDateTime = ParamDateTime { unParamDateTime :: DateTime } deriving (P.Eq, P.Show)
|
||||
newtype ParamDouble = ParamDouble { unParamDouble :: Double } deriving (P.Eq, P.Show)
|
||||
newtype ParamFloat = ParamFloat { unParamFloat :: Float } deriving (P.Eq, P.Show)
|
||||
newtype ParamInteger = ParamInteger { unParamInteger :: Int } deriving (P.Eq, P.Show)
|
||||
newtype ParamString = ParamString { unParamString :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Password = Password { unPassword :: Text } deriving (P.Eq, P.Show)
|
||||
newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDelimiter :: Text } deriving (P.Eq, P.Show)
|
||||
newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
|
||||
newtype Status = Status { unStatus :: [Text] } deriving (P.Eq, P.Show)
|
||||
newtype StatusText = StatusText { unStatusText :: Text } deriving (P.Eq, P.Show)
|
||||
newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
|
||||
newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- * Utils
|
||||
|
||||
-- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON)
|
||||
|
@ -1,7 +1,3 @@
|
||||
-- This file has been generated from package.yaml by hpack version 0.17.1.
|
||||
--
|
||||
-- see: https://github.com/sol/hpack
|
||||
|
||||
name: swagger-petstore
|
||||
version: 0.1.0.0
|
||||
synopsis: Auto-generated swagger-petstore API Client
|
||||
@ -12,9 +8,9 @@ description: .
|
||||
.
|
||||
base path: http://petstore.swagger.io:80/v2
|
||||
.
|
||||
apiVersion: 0.0.1
|
||||
Swagger Petstore API version: 1.0.0
|
||||
.
|
||||
swagger version: 2.0
|
||||
OpenAPI spec version: 2.0
|
||||
.
|
||||
OpenAPI-Specification: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
|
||||
.
|
||||
|
@ -9,7 +9,7 @@
|
||||
"email" : "apiteam@swagger.io"
|
||||
},
|
||||
"license" : {
|
||||
"name" : "Apache 2.0",
|
||||
"name" : "Apache-2.0",
|
||||
"url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user