@@ -12,6 +12,131 @@ module Yoga.HTTP.API.Route.Response
1212 , respondNothing
1313 , respondNoContent
1414 , respondNotModified
15+ -- Status code helpers
16+, continue
17+, continueWith
18+, switchingProtocols
19+, switchingProtocolsWith
20+, processing
21+, processingWith
22+, earlyHints
23+, earlyHintsWith
24+, ok
25+, okWith
26+, created
27+, createdWith
28+, accepted
29+, acceptedWith
30+, nonAuthoritativeInformation
31+, nonAuthoritativeInformationWith
32+, noContent
33+, noContentWith
34+, resetContent
35+, resetContentWith
36+, partialContent
37+, partialContentWith
38+, multiStatus
39+, multiStatusWith
40+, alreadyReported
41+, alreadyReportedWith
42+, imUsed
43+, imUsedWith
44+, multipleChoices
45+, multipleChoicesWith
46+, movedPermanently
47+, movedPermanentlyWith
48+, found
49+, foundWith
50+, seeOther
51+, seeOtherWith
52+, notModified
53+, notModifiedWith
54+, useProxy
55+, useProxyWith
56+, temporaryRedirect
57+, temporaryRedirectWith
58+, permanentRedirect
59+, permanentRedirectWith
60+, badRequest
61+, badRequestWith
62+, unauthorized
63+, unauthorizedWith
64+, paymentRequired
65+, paymentRequiredWith
66+, forbidden
67+, forbiddenWith
68+, notFound
69+, notFoundWith
70+, methodNotAllowed
71+, methodNotAllowedWith
72+, notAcceptable
73+, notAcceptableWith
74+, proxyAuthenticationRequired
75+, proxyAuthenticationRequiredWith
76+, requestTimeout
77+, requestTimeoutWith
78+, conflict
79+, conflictWith
80+, gone
81+, goneWith
82+, lengthRequired
83+, lengthRequiredWith
84+, preconditionFailed
85+, preconditionFailedWith
86+, payloadTooLarge
87+, payloadTooLargeWith
88+, uriTooLong
89+, uriTooLongWith
90+, unsupportedMediaType
91+, unsupportedMediaTypeWith
92+, rangeNotSatisfiable
93+, rangeNotSatisfiableWith
94+, expectationFailed
95+, expectationFailedWith
96+, imATeapot
97+, imATeapotWith
98+, misdirectedRequest
99+, misdirectedRequestWith
100+, unprocessableEntity
101+, unprocessableEntityWith
102+, locked
103+, lockedWith
104+, failedDependency
105+, failedDependencyWith
106+, tooEarly
107+, tooEarlyWith
108+, upgradeRequired
109+, upgradeRequiredWith
110+, preconditionRequired
111+, preconditionRequiredWith
112+, tooManyRequests
113+, tooManyRequestsWith
114+, requestHeaderFieldsTooLarge
115+, requestHeaderFieldsTooLargeWith
116+, unavailableForLegalReasons
117+, unavailableForLegalReasonsWith
118+, internalServerError
119+, internalServerErrorWith
120+, notImplemented
121+, notImplementedWith
122+, badGateway
123+, badGatewayWith
124+, serviceUnavailable
125+, serviceUnavailableWith
126+, gatewayTimeout
127+, gatewayTimeoutWith
128+, httpVersionNotSupported
129+, httpVersionNotSupportedWith
130+, variantAlsoNegotiates
131+, variantAlsoNegotiatesWith
132+, insufficientStorage
133+, insufficientStorageWith
134+, loopDetected
135+, loopDetectedWith
136+, notExtended
137+, notExtendedWith
138+, networkAuthenticationRequired
139+, networkAuthenticationRequiredWith
15140 , module Data.Variant
16141 ) where
17142
@@ -240,3 +365,256 @@ respondNotModified
240365 => Variant r2
241366respondNotModified =
242367 unsafeCoerce (Variant.inj (Proxy :: Proxy "notModified") (Response { headers: {}, body: unit }))
368+
369+--------------------------------------------------------------------------------
370+-- Status Code Helper Functions
371+--------------------------------------------------------------------------------
372+
373+continue = respondNoHeaders @"continue"
374+
375+continueWith = respondWith (Proxy :: Proxy "continue")
376+
377+switchingProtocols = respondNoHeaders @"switchingProtocols"
378+
379+switchingProtocolsWith = respondWith (Proxy :: Proxy "switchingProtocols")
380+
381+processing = respondNoHeaders @"processing"
382+
383+processingWith = respondWith (Proxy :: Proxy "processing")
384+
385+earlyHints = respondNoHeaders @"earlyHints"
386+
387+earlyHintsWith = respondWith (Proxy :: Proxy "earlyHints")
388+
389+ok = respondNoHeaders @"ok"
390+
391+okWith = respondWith (Proxy :: Proxy "ok")
392+
393+created = respondNoHeaders @"created"
394+
395+createdWith = respondWith (Proxy :: Proxy "created")
396+
397+accepted = respondNoHeaders @"accepted"
398+
399+acceptedWith = respondWith (Proxy :: Proxy "accepted")
400+
401+nonAuthoritativeInformation = respondNoHeaders @"nonAuthoritativeInformation"
402+
403+nonAuthoritativeInformationWith = respondWith (Proxy :: Proxy "nonAuthoritativeInformation")
404+
405+noContent = respondNoHeaders @"noContent"
406+
407+noContentWith = respondWith (Proxy :: Proxy "noContent")
408+
409+resetContent = respondNoHeaders @"resetContent"
410+
411+resetContentWith = respondWith (Proxy :: Proxy "resetContent")
412+
413+partialContent = respondNoHeaders @"partialContent"
414+
415+partialContentWith = respondWith (Proxy :: Proxy "partialContent")
416+
417+multiStatus = respondNoHeaders @"multiStatus"
418+
419+multiStatusWith = respondWith (Proxy :: Proxy "multiStatus")
420+
421+alreadyReported = respondNoHeaders @"alreadyReported"
422+
423+alreadyReportedWith = respondWith (Proxy :: Proxy "alreadyReported")
424+
425+imUsed = respondNoHeaders @"imUsed"
426+
427+imUsedWith = respondWith (Proxy :: Proxy "imUsed")
428+
429+multipleChoices = respondNoHeaders @"multipleChoices"
430+
431+multipleChoicesWith = respondWith (Proxy :: Proxy "multipleChoices")
432+
433+movedPermanently = respondNoHeaders @"movedPermanently"
434+
435+movedPermanentlyWith = respondWith (Proxy :: Proxy "movedPermanently")
436+
437+found = respondNoHeaders @"found"
438+
439+foundWith = respondWith (Proxy :: Proxy "found")
440+
441+seeOther = respondNoHeaders @"seeOther"
442+
443+seeOtherWith = respondWith (Proxy :: Proxy "seeOther")
444+
445+notModified = respondNoHeaders @"notModified"
446+
447+notModifiedWith = respondWith (Proxy :: Proxy "notModified")
448+
449+useProxy = respondNoHeaders @"useProxy"
450+
451+useProxyWith = respondWith (Proxy :: Proxy "useProxy")
452+
453+temporaryRedirect = respondNoHeaders @"temporaryRedirect"
454+
455+temporaryRedirectWith = respondWith (Proxy :: Proxy "temporaryRedirect")
456+
457+permanentRedirect = respondNoHeaders @"permanentRedirect"
458+
459+permanentRedirectWith = respondWith (Proxy :: Proxy "permanentRedirect")
460+
461+badRequest = respondNoHeaders @"badRequest"
462+
463+badRequestWith = respondWith (Proxy :: Proxy "badRequest")
464+
465+unauthorized = respondNoHeaders @"unauthorized"
466+
467+unauthorizedWith = respondWith (Proxy :: Proxy "unauthorized")
468+
469+paymentRequired = respondNoHeaders @"paymentRequired"
470+
471+paymentRequiredWith = respondWith (Proxy :: Proxy "paymentRequired")
472+
473+forbidden = respondNoHeaders @"forbidden"
474+
475+forbiddenWith = respondWith (Proxy :: Proxy "forbidden")
476+
477+notFound = respondNoHeaders @"notFound"
478+
479+notFoundWith = respondWith (Proxy :: Proxy "notFound")
480+
481+methodNotAllowed = respondNoHeaders @"methodNotAllowed"
482+
483+methodNotAllowedWith = respondWith (Proxy :: Proxy "methodNotAllowed")
484+
485+notAcceptable = respondNoHeaders @"notAcceptable"
486+
487+notAcceptableWith = respondWith (Proxy :: Proxy "notAcceptable")
488+
489+proxyAuthenticationRequired = respondNoHeaders @"proxyAuthenticationRequired"
490+
491+proxyAuthenticationRequiredWith = respondWith (Proxy :: Proxy "proxyAuthenticationRequired")
492+
493+requestTimeout = respondNoHeaders @"requestTimeout"
494+
495+requestTimeoutWith = respondWith (Proxy :: Proxy "requestTimeout")
496+
497+conflict = respondNoHeaders @"conflict"
498+
499+conflictWith = respondWith (Proxy :: Proxy "conflict")
500+
501+gone = respondNoHeaders @"gone"
502+
503+goneWith = respondWith (Proxy :: Proxy "gone")
504+
505+lengthRequired = respondNoHeaders @"lengthRequired"
506+
507+lengthRequiredWith = respondWith (Proxy :: Proxy "lengthRequired")
508+
509+preconditionFailed = respondNoHeaders @"preconditionFailed"
510+
511+preconditionFailedWith = respondWith (Proxy :: Proxy "preconditionFailed")
512+
513+payloadTooLarge = respondNoHeaders @"payloadTooLarge"
514+
515+payloadTooLargeWith = respondWith (Proxy :: Proxy "payloadTooLarge")
516+
517+uriTooLong = respondNoHeaders @"uriTooLong"
518+
519+uriTooLongWith = respondWith (Proxy :: Proxy "uriTooLong")
520+
521+unsupportedMediaType = respondNoHeaders @"unsupportedMediaType"
522+
523+unsupportedMediaTypeWith = respondWith (Proxy :: Proxy "unsupportedMediaType")
524+
525+rangeNotSatisfiable = respondNoHeaders @"rangeNotSatisfiable"
526+
527+rangeNotSatisfiableWith = respondWith (Proxy :: Proxy "rangeNotSatisfiable")
528+
529+expectationFailed = respondNoHeaders @"expectationFailed"
530+
531+expectationFailedWith = respondWith (Proxy :: Proxy "expectationFailed")
532+
533+imATeapot = respondNoHeaders @"imATeapot"
534+
535+imATeapotWith = respondWith (Proxy :: Proxy "imATeapot")
536+
537+misdirectedRequest = respondNoHeaders @"misdirectedRequest"
538+
539+misdirectedRequestWith = respondWith (Proxy :: Proxy "misdirectedRequest")
540+
541+unprocessableEntity = respondNoHeaders @"unprocessableEntity"
542+
543+unprocessableEntityWith = respondWith (Proxy :: Proxy "unprocessableEntity")
544+
545+locked = respondNoHeaders @"locked"
546+
547+lockedWith = respondWith (Proxy :: Proxy "locked")
548+
549+failedDependency = respondNoHeaders @"failedDependency"
550+
551+failedDependencyWith = respondWith (Proxy :: Proxy "failedDependency")
552+
553+tooEarly = respondNoHeaders @"tooEarly"
554+
555+tooEarlyWith = respondWith (Proxy :: Proxy "tooEarly")
556+
557+upgradeRequired = respondNoHeaders @"upgradeRequired"
558+
559+upgradeRequiredWith = respondWith (Proxy :: Proxy "upgradeRequired")
560+
561+preconditionRequired = respondNoHeaders @"preconditionRequired"
562+
563+preconditionRequiredWith = respondWith (Proxy :: Proxy "preconditionRequired")
564+
565+tooManyRequests = respondNoHeaders @"tooManyRequests"
566+
567+tooManyRequestsWith = respondWith (Proxy :: Proxy "tooManyRequests")
568+
569+requestHeaderFieldsTooLarge = respondNoHeaders @"requestHeaderFieldsTooLarge"
570+
571+requestHeaderFieldsTooLargeWith = respondWith (Proxy :: Proxy "requestHeaderFieldsTooLarge")
572+
573+unavailableForLegalReasons = respondNoHeaders @"unavailableForLegalReasons"
574+
575+unavailableForLegalReasonsWith = respondWith (Proxy :: Proxy "unavailableForLegalReasons")
576+
577+internalServerError = respondNoHeaders @"internalServerError"
578+
579+internalServerErrorWith = respondWith (Proxy :: Proxy "internalServerError")
580+
581+notImplemented = respondNoHeaders @"notImplemented"
582+
583+notImplementedWith = respondWith (Proxy :: Proxy "notImplemented")
584+
585+badGateway = respondNoHeaders @"badGateway"
586+
587+badGatewayWith = respondWith (Proxy :: Proxy "badGateway")
588+
589+serviceUnavailable = respondNoHeaders @"serviceUnavailable"
590+
591+serviceUnavailableWith = respondWith (Proxy :: Proxy "serviceUnavailable")
592+
593+gatewayTimeout = respondNoHeaders @"gatewayTimeout"
594+
595+gatewayTimeoutWith = respondWith (Proxy :: Proxy "gatewayTimeout")
596+
597+httpVersionNotSupported = respondNoHeaders @"httpVersionNotSupported"
598+
599+httpVersionNotSupportedWith = respondWith (Proxy :: Proxy "httpVersionNotSupported")
600+
601+variantAlsoNegotiates = respondNoHeaders @"variantAlsoNegotiates"
602+
603+variantAlsoNegotiatesWith = respondWith (Proxy :: Proxy "variantAlsoNegotiates")
604+
605+insufficientStorage = respondNoHeaders @"insufficientStorage"
606+
607+insufficientStorageWith = respondWith (Proxy :: Proxy "insufficientStorage")
608+
609+loopDetected = respondNoHeaders @"loopDetected"
610+
611+loopDetectedWith = respondWith (Proxy :: Proxy "loopDetected")
612+
613+notExtended = respondNoHeaders @"notExtended"
614+
615+notExtendedWith = respondWith (Proxy :: Proxy "notExtended")
616+
617+networkAuthenticationRequired = respondNoHeaders @"networkAuthenticationRequired"
618+
619+networkAuthenticationRequiredWith = respondWith (Proxy :: Proxy "networkAuthenticationRequired")
620+