{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Data.Swagger.Optics () where
import Data.Aeson (Value)
import Data.Scientific (Scientific)
import Data.Swagger.Internal
import Data.Text (Text)
import Optics.Core
import Optics.TH
makeFieldLabels ''Swagger
makeFieldLabels ''Host
makeFieldLabels ''Info
makeFieldLabels ''Contact
makeFieldLabels ''License
makeFieldLabels ''PathItem
makeFieldLabels ''Tag
makeFieldLabels ''Operation
makeFieldLabels ''Param
makeFieldLabels ''ParamOtherSchema
makeFieldLabels ''Header
makeFieldLabels ''Schema
makeFieldLabels ''NamedSchema
makeFieldLabels ''ParamSchema
makeFieldLabels ''Xml
makeFieldLabels ''Responses
makeFieldLabels ''Response
makeFieldLabels ''SecurityScheme
makeFieldLabels ''ApiKeyParams
makeFieldLabels ''OAuth2Params
makeFieldLabels ''ExternalDocs
makePrismLabels ''ParamAnySchema
makePrismLabels ''SecuritySchemeType
makePrismLabels ''Referenced
instance
( a ~ [Referenced Schema]
, b ~ [Referenced Schema]
) => LabelOptic "_SwaggerItemsArray"
A_Review
(SwaggerItems 'SwaggerKindSchema)
(SwaggerItems 'SwaggerKindSchema)
a
b where
labelOptic = unto (\x -> SwaggerItemsArray x)
{-# INLINE labelOptic #-}
instance
( a ~ Referenced Schema
, b ~ Referenced Schema
) => LabelOptic "_SwaggerItemsObject"
A_Review
(SwaggerItems 'SwaggerKindSchema)
(SwaggerItems 'SwaggerKindSchema)
a
b where
labelOptic = unto (\x -> SwaggerItemsObject x)
{-# INLINE labelOptic #-}
instance
( a ~ (Maybe (CollectionFormat t), ParamSchema t)
, b ~ (Maybe (CollectionFormat t), ParamSchema t)
) => LabelOptic "_SwaggerItemsPrimitive"
A_Review
(SwaggerItems t)
(SwaggerItems t)
a
b where
labelOptic = unto (\(c, p) -> SwaggerItemsPrimitive c p)
{-# INLINE labelOptic #-}
type instance Index Responses = HttpStatusCode
type instance Index Operation = HttpStatusCode
type instance IxValue Responses = Referenced Response
type instance IxValue Operation = Referenced Response
instance Ixed Responses where
ix n = #responses % ix n
{-# INLINE ix #-}
instance At Responses where
at n = #responses % at n
{-# INLINE at #-}
instance Ixed Operation where
ix n = #responses % ix n
{-# INLINE ix #-}
instance At Operation where
at n = #responses % at n
{-# INLINE at #-}
instance
( a ~ ParamSchema 'SwaggerKindSchema
, b ~ ParamSchema 'SwaggerKindSchema
) => LabelOptic "paramSchema" A_Lens NamedSchema NamedSchema a b where
labelOptic = #schema % #paramSchema
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerType ('SwaggerKindNormal Header))
, b ~ Maybe (SwaggerType ('SwaggerKindNormal Header))
) => LabelOptic "type" A_Lens Header Header a b where
labelOptic = #paramSchema % #type
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerType 'SwaggerKindSchema)
, b ~ Maybe (SwaggerType 'SwaggerKindSchema)
) => LabelOptic "type" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #type
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerType 'SwaggerKindSchema)
, b ~ Maybe (SwaggerType 'SwaggerKindSchema)
) => LabelOptic "type" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #type
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerType 'SwaggerKindParamOtherSchema)
, b ~ Maybe (SwaggerType 'SwaggerKindParamOtherSchema)
) => LabelOptic "type" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #type
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Value, b ~ Maybe Value
) => LabelOptic "default" A_Lens Header Header a b where
labelOptic = #paramSchema % #default
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Value, b ~ Maybe Value
) => LabelOptic "default" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #default
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Value, b ~ Maybe Value
) => LabelOptic "default" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #default
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Value, b ~ Maybe Value
) => LabelOptic "default" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #default
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Format, b ~ Maybe Format
) => LabelOptic "format" A_Lens Header Header a b where
labelOptic = #paramSchema % #format
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Format, b ~ Maybe Format
) => LabelOptic "format" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #format
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Format, b ~ Maybe Format
) => LabelOptic "format" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #format
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Format, b ~ Maybe Format
) => LabelOptic "format" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #format
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerItems ('SwaggerKindNormal Header))
, b ~ Maybe (SwaggerItems ('SwaggerKindNormal Header))
) => LabelOptic "items" A_Lens Header Header a b where
labelOptic = #paramSchema % #items
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerItems 'SwaggerKindSchema)
, b ~ Maybe (SwaggerItems 'SwaggerKindSchema)
) => LabelOptic "items" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #items
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerItems 'SwaggerKindSchema)
, b ~ Maybe (SwaggerItems 'SwaggerKindSchema)
) => LabelOptic "items" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #items
{-# INLINE labelOptic #-}
instance
( a ~ Maybe (SwaggerItems 'SwaggerKindParamOtherSchema)
, b ~ Maybe (SwaggerItems 'SwaggerKindParamOtherSchema)
) => LabelOptic "items" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #items
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "maximum" A_Lens Header Header a b where
labelOptic = #paramSchema % #maximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "maximum" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #maximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "maximum" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #maximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "maximum" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #maximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMaximum" A_Lens Header Header a b where
labelOptic = #paramSchema % #exclusiveMaximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMaximum" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #exclusiveMaximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMaximum" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #exclusiveMaximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMaximum" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #exclusiveMaximum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "minimum" A_Lens Header Header a b where
labelOptic = #paramSchema % #minimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "minimum" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #minimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "minimum" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #minimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "minimum" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #minimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMinimum" A_Lens Header Header a b where
labelOptic = #paramSchema % #exclusiveMinimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMinimum" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #exclusiveMinimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMinimum" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #exclusiveMinimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "exclusiveMinimum" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #exclusiveMinimum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxLength" A_Lens Header Header a b where
labelOptic = #paramSchema % #maxLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxLength" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #maxLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxLength" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #maxLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxLength" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #maxLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minLength" A_Lens Header Header a b where
labelOptic = #paramSchema % #minLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minLength" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #minLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minLength" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #minLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minLength" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #minLength
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Text, b ~ Maybe Text
) => LabelOptic "pattern" A_Lens Header Header a b where
labelOptic = #paramSchema % #pattern
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Text, b ~ Maybe Text
) => LabelOptic "pattern" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #pattern
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Text, b ~ Maybe Text
) => LabelOptic "pattern" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #pattern
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Text, b ~ Maybe Text
) => LabelOptic "pattern" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #pattern
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxItems" A_Lens Header Header a b where
labelOptic = #paramSchema % #maxItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxItems" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #maxItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxItems" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #maxItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "maxItems" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #maxItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minItems" A_Lens Header Header a b where
labelOptic = #paramSchema % #minItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minItems" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #minItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minItems" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #minItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Integer, b ~ Maybe Integer
) => LabelOptic "minItems" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #minItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "uniqueItems" A_Lens Header Header a b where
labelOptic = #paramSchema % #uniqueItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "uniqueItems" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #uniqueItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "uniqueItems" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #uniqueItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Bool, b ~ Maybe Bool
) => LabelOptic "uniqueItems" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #uniqueItems
{-# INLINE labelOptic #-}
instance
( a ~ Maybe [Value], b ~ Maybe [Value]
) => LabelOptic "enum" A_Lens Header Header a b where
labelOptic = #paramSchema % #enum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe [Value], b ~ Maybe [Value]
) => LabelOptic "enum" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #enum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe [Value], b ~ Maybe [Value]
) => LabelOptic "enum" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #enum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe [Value], b ~ Maybe [Value]
) => LabelOptic "enum" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #enum
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "multipleOf" A_Lens Header Header a b where
labelOptic = #paramSchema % #multipleOf
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "multipleOf" A_Lens Schema Schema a b where
labelOptic = #paramSchema % #multipleOf
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "multipleOf" A_Lens NamedSchema NamedSchema a b where
labelOptic = #paramSchema % #multipleOf
{-# INLINE labelOptic #-}
instance
( a ~ Maybe Scientific, b ~ Maybe Scientific
) => LabelOptic "multipleOf" A_Lens ParamOtherSchema ParamOtherSchema a b where
labelOptic = #paramSchema % #multipleOf
{-# INLINE labelOptic #-}