{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
-- Module:      Data.Swagger.Lens
-- Maintainer:  Nickolay Kudasov <nickolay@getshoptv.com>
-- Stability:   experimental
--
-- Lenses and prisms for Swagger.
module Data.Swagger.Lens where

import Control.Lens
import Data.Aeson (Value)
import Data.Scientific (Scientific)
import Data.Swagger.Internal
import Data.Swagger.Internal.Utils
import Data.Text (Text)

-- * Classy lenses

makeFields ''Swagger
makeFields ''Host
makeFields ''Info
makeFields ''Contact
makeFields ''License
makeLensesWith swaggerFieldRules ''PathItem
makeFields ''Tag
makeFields ''Operation
makeFields ''Param
makeLensesWith swaggerFieldRules ''ParamOtherSchema
makeFields ''Header
makeFields ''Schema
makeFields ''NamedSchema
makeLensesWith swaggerFieldRules ''ParamSchema
makeFields ''Xml
makeLensesWith swaggerFieldRules ''Responses
makeFields ''Response
makeLensesWith swaggerFieldRules ''SecurityScheme
makeFields ''ApiKeyParams
makeFields ''OAuth2Params
makeFields ''ExternalDocs

-- * Prisms
-- ** 'ParamAnySchema' prisms
makePrisms ''ParamAnySchema
-- ** 'SecuritySchemeType' prisms
makePrisms ''SecuritySchemeType
-- ** 'Referenced' prisms
makePrisms ''Referenced

-- ** 'SwaggerItems' prisms

_SwaggerItemsArray :: Review (SwaggerItems 'SwaggerKindSchema) [Referenced Schema]
_SwaggerItemsArray :: Optic' p f (SwaggerItems 'SwaggerKindSchema) [Referenced Schema]
_SwaggerItemsArray
  = ([Referenced Schema] -> SwaggerItems 'SwaggerKindSchema)
-> Optic' p f (SwaggerItems 'SwaggerKindSchema) [Referenced Schema]
forall (p :: * -> * -> *) (f :: * -> *) b t s a.
(Profunctor p, Bifunctor p, Functor f) =>
(b -> t) -> Optic p f s t a b
unto (\[Referenced Schema]
x -> [Referenced Schema] -> SwaggerItems 'SwaggerKindSchema
SwaggerItemsArray [Referenced Schema]
x)
{- \x -> case x of
      SwaggerItemsPrimitive c p -> Left (SwaggerItemsPrimitive c p)
      SwaggerItemsObject o      -> Left (SwaggerItemsObject o)
      SwaggerItemsArray a       -> Right a
-}

_SwaggerItemsObject :: Review (SwaggerItems 'SwaggerKindSchema) (Referenced Schema)
_SwaggerItemsObject :: Optic' p f (SwaggerItems 'SwaggerKindSchema) (Referenced Schema)
_SwaggerItemsObject
  = (Referenced Schema -> SwaggerItems 'SwaggerKindSchema)
-> Optic' p f (SwaggerItems 'SwaggerKindSchema) (Referenced Schema)
forall (p :: * -> * -> *) (f :: * -> *) b t s a.
(Profunctor p, Bifunctor p, Functor f) =>
(b -> t) -> Optic p f s t a b
unto (\Referenced Schema
x -> Referenced Schema -> SwaggerItems 'SwaggerKindSchema
SwaggerItemsObject Referenced Schema
x)
{- \x -> case x of
      SwaggerItemsPrimitive c p -> Left (SwaggerItemsPrimitive c p)
      SwaggerItemsObject o      -> Right o
      SwaggerItemsArray a       -> Left (SwaggerItemsArray a)
-}

_SwaggerItemsPrimitive :: forall t p f. (Profunctor p, Bifunctor p, Functor f) => Optic' p f (SwaggerItems t) (Maybe (CollectionFormat t), ParamSchema t)
_SwaggerItemsPrimitive :: Optic'
  p f (SwaggerItems t) (Maybe (CollectionFormat t), ParamSchema t)
_SwaggerItemsPrimitive = ((Maybe (CollectionFormat t), ParamSchema t) -> SwaggerItems t)
-> Optic'
     p f (SwaggerItems t) (Maybe (CollectionFormat t), ParamSchema t)
forall (p :: * -> * -> *) (f :: * -> *) b t s a.
(Profunctor p, Bifunctor p, Functor f) =>
(b -> t) -> Optic p f s t a b
unto (\(Maybe (CollectionFormat t)
c, ParamSchema t
p) -> Maybe (CollectionFormat t) -> ParamSchema t -> SwaggerItems t
forall (k :: SwaggerKind *).
Maybe (CollectionFormat k) -> ParamSchema k -> SwaggerItems k
SwaggerItemsPrimitive Maybe (CollectionFormat t)
c ParamSchema t
p)

-- =============================================================
-- More helpful instances for easier access to schema properties

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 :: Index Responses -> Traversal' Responses (IxValue Responses)
ix Index Responses
n = (InsOrdHashMap HttpStatusCode (Referenced Response)
 -> f (InsOrdHashMap HttpStatusCode (Referenced Response)))
-> Responses -> f Responses
forall s a. HasResponses s a => Lens' s a
responses ((InsOrdHashMap HttpStatusCode (Referenced Response)
  -> f (InsOrdHashMap HttpStatusCode (Referenced Response)))
 -> Responses -> f Responses)
-> ((Referenced Response -> f (Referenced Response))
    -> InsOrdHashMap HttpStatusCode (Referenced Response)
    -> f (InsOrdHashMap HttpStatusCode (Referenced Response)))
-> (Referenced Response -> f (Referenced Response))
-> Responses
-> f Responses
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (InsOrdHashMap HttpStatusCode (Referenced Response))
-> Traversal'
     (InsOrdHashMap HttpStatusCode (Referenced Response))
     (IxValue (InsOrdHashMap HttpStatusCode (Referenced Response)))
forall m. Ixed m => Index m -> Traversal' m (IxValue m)
ix Index (InsOrdHashMap HttpStatusCode (Referenced Response))
Index Responses
n
instance At   Responses where at :: Index Responses -> Lens' Responses (Maybe (IxValue Responses))
at Index Responses
n = (InsOrdHashMap HttpStatusCode (Referenced Response)
 -> f (InsOrdHashMap HttpStatusCode (Referenced Response)))
-> Responses -> f Responses
forall s a. HasResponses s a => Lens' s a
responses ((InsOrdHashMap HttpStatusCode (Referenced Response)
  -> f (InsOrdHashMap HttpStatusCode (Referenced Response)))
 -> Responses -> f Responses)
-> ((Maybe (Referenced Response)
     -> f (Maybe (Referenced Response)))
    -> InsOrdHashMap HttpStatusCode (Referenced Response)
    -> f (InsOrdHashMap HttpStatusCode (Referenced Response)))
-> (Maybe (Referenced Response) -> f (Maybe (Referenced Response)))
-> Responses
-> f Responses
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (InsOrdHashMap HttpStatusCode (Referenced Response))
-> Lens'
     (InsOrdHashMap HttpStatusCode (Referenced Response))
     (Maybe
        (IxValue (InsOrdHashMap HttpStatusCode (Referenced Response))))
forall m. At m => Index m -> Lens' m (Maybe (IxValue m))
at Index (InsOrdHashMap HttpStatusCode (Referenced Response))
Index Responses
n

instance Ixed Operation where ix :: Index Operation -> Traversal' Operation (IxValue Operation)
ix Index Operation
n = (Responses -> f Responses) -> Operation -> f Operation
forall s a. HasResponses s a => Lens' s a
responses ((Responses -> f Responses) -> Operation -> f Operation)
-> ((Referenced Response -> f (Referenced Response))
    -> Responses -> f Responses)
-> (Referenced Response -> f (Referenced Response))
-> Operation
-> f Operation
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index Responses -> Traversal' Responses (IxValue Responses)
forall m. Ixed m => Index m -> Traversal' m (IxValue m)
ix Index Responses
Index Operation
n
instance At   Operation where at :: Index Operation -> Lens' Operation (Maybe (IxValue Operation))
at Index Operation
n = (Responses -> f Responses) -> Operation -> f Operation
forall s a. HasResponses s a => Lens' s a
responses ((Responses -> f Responses) -> Operation -> f Operation)
-> ((Maybe (Referenced Response)
     -> f (Maybe (Referenced Response)))
    -> Responses -> f Responses)
-> (Maybe (Referenced Response) -> f (Maybe (Referenced Response)))
-> Operation
-> f Operation
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index Responses -> Lens' Responses (Maybe (IxValue Responses))
forall m. At m => Index m -> Lens' m (Maybe (IxValue m))
at Index Responses
Index Operation
n

type instance Index SecurityDefinitions = Text
type instance IxValue SecurityDefinitions = SecurityScheme

instance Ixed SecurityDefinitions where ix :: Index SecurityDefinitions
-> Traversal' SecurityDefinitions (IxValue SecurityDefinitions)
ix Index SecurityDefinitions
n = (forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
forall (f :: * -> *).
Functor f =>
(Definitions SecurityScheme -> f (Definitions SecurityScheme))
-> SecurityDefinitions -> f SecurityDefinitions
coerced :: Lens' SecurityDefinitions (Definitions SecurityScheme))((Definitions SecurityScheme -> f (Definitions SecurityScheme))
 -> SecurityDefinitions -> f SecurityDefinitions)
-> ((SecurityScheme -> f SecurityScheme)
    -> Definitions SecurityScheme -> f (Definitions SecurityScheme))
-> (SecurityScheme -> f SecurityScheme)
-> SecurityDefinitions
-> f SecurityDefinitions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (Definitions SecurityScheme)
-> Traversal'
     (Definitions SecurityScheme) (IxValue (Definitions SecurityScheme))
forall m. Ixed m => Index m -> Traversal' m (IxValue m)
ix Index (Definitions SecurityScheme)
Index SecurityDefinitions
n
instance At   SecurityDefinitions where at :: Index SecurityDefinitions
-> Lens' SecurityDefinitions (Maybe (IxValue SecurityDefinitions))
at Index SecurityDefinitions
n = (forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
forall (f :: * -> *).
Functor f =>
(Definitions SecurityScheme -> f (Definitions SecurityScheme))
-> SecurityDefinitions -> f SecurityDefinitions
coerced :: Lens' SecurityDefinitions (Definitions SecurityScheme))((Definitions SecurityScheme -> f (Definitions SecurityScheme))
 -> SecurityDefinitions -> f SecurityDefinitions)
-> ((Maybe SecurityScheme -> f (Maybe SecurityScheme))
    -> Definitions SecurityScheme -> f (Definitions SecurityScheme))
-> (Maybe SecurityScheme -> f (Maybe SecurityScheme))
-> SecurityDefinitions
-> f SecurityDefinitions
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (Definitions SecurityScheme)
-> Lens'
     (Definitions SecurityScheme)
     (Maybe (IxValue (Definitions SecurityScheme)))
forall m. At m => Index m -> Lens' m (Maybe (IxValue m))
at Index (Definitions SecurityScheme)
Index SecurityDefinitions
n

instance HasParamSchema NamedSchema (ParamSchema 'SwaggerKindSchema) where paramSchema :: (ParamSchema 'SwaggerKindSchema
 -> f (ParamSchema 'SwaggerKindSchema))
-> NamedSchema -> f NamedSchema
paramSchema = (Schema -> f Schema) -> NamedSchema -> f NamedSchema
forall s a. HasSchema s a => Lens' s a
schema((Schema -> f Schema) -> NamedSchema -> f NamedSchema)
-> ((ParamSchema 'SwaggerKindSchema
     -> f (ParamSchema 'SwaggerKindSchema))
    -> Schema -> f Schema)
-> (ParamSchema 'SwaggerKindSchema
    -> f (ParamSchema 'SwaggerKindSchema))
-> NamedSchema
-> f NamedSchema
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(ParamSchema 'SwaggerKindSchema
 -> f (ParamSchema 'SwaggerKindSchema))
-> Schema -> f Schema
forall s a. HasParamSchema s a => Lens' s a
paramSchema

-- HasType instances
instance HasType Header (Maybe (SwaggerType ('SwaggerKindNormal Header))) where type_ :: (Maybe (SwaggerType ('SwaggerKindNormal Header))
 -> f (Maybe (SwaggerType ('SwaggerKindNormal Header))))
-> Header -> f Header
type_ = (ParamSchema ('SwaggerKindNormal Header)
 -> f (ParamSchema ('SwaggerKindNormal Header)))
-> Header -> f Header
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema ('SwaggerKindNormal Header)
  -> f (ParamSchema ('SwaggerKindNormal Header)))
 -> Header -> f Header)
-> ((Maybe (SwaggerType ('SwaggerKindNormal Header))
     -> f (Maybe (SwaggerType ('SwaggerKindNormal Header))))
    -> ParamSchema ('SwaggerKindNormal Header)
    -> f (ParamSchema ('SwaggerKindNormal Header)))
-> (Maybe (SwaggerType ('SwaggerKindNormal Header))
    -> f (Maybe (SwaggerType ('SwaggerKindNormal Header))))
-> Header
-> f Header
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe (SwaggerType ('SwaggerKindNormal Header))
 -> f (Maybe (SwaggerType ('SwaggerKindNormal Header))))
-> ParamSchema ('SwaggerKindNormal Header)
-> f (ParamSchema ('SwaggerKindNormal Header))
forall s a. HasType s a => Lens' s a
type_
instance HasType Schema (Maybe (SwaggerType 'SwaggerKindSchema)) where type_ :: (Maybe (SwaggerType 'SwaggerKindSchema)
 -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
-> Schema -> f Schema
type_ = (ParamSchema 'SwaggerKindSchema
 -> f (ParamSchema 'SwaggerKindSchema))
-> Schema -> f Schema
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema 'SwaggerKindSchema
  -> f (ParamSchema 'SwaggerKindSchema))
 -> Schema -> f Schema)
-> ((Maybe (SwaggerType 'SwaggerKindSchema)
     -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
    -> ParamSchema 'SwaggerKindSchema
    -> f (ParamSchema 'SwaggerKindSchema))
-> (Maybe (SwaggerType 'SwaggerKindSchema)
    -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
-> Schema
-> f Schema
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe (SwaggerType 'SwaggerKindSchema)
 -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
-> ParamSchema 'SwaggerKindSchema
-> f (ParamSchema 'SwaggerKindSchema)
forall s a. HasType s a => Lens' s a
type_
instance HasType NamedSchema (Maybe (SwaggerType 'SwaggerKindSchema)) where type_ :: (Maybe (SwaggerType 'SwaggerKindSchema)
 -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
-> NamedSchema -> f NamedSchema
type_ = (ParamSchema 'SwaggerKindSchema
 -> f (ParamSchema 'SwaggerKindSchema))
-> NamedSchema -> f NamedSchema
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema 'SwaggerKindSchema
  -> f (ParamSchema 'SwaggerKindSchema))
 -> NamedSchema -> f NamedSchema)
-> ((Maybe (SwaggerType 'SwaggerKindSchema)
     -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
    -> ParamSchema 'SwaggerKindSchema
    -> f (ParamSchema 'SwaggerKindSchema))
-> (Maybe (SwaggerType 'SwaggerKindSchema)
    -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
-> NamedSchema
-> f NamedSchema
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe (SwaggerType 'SwaggerKindSchema)
 -> f (Maybe (SwaggerType 'SwaggerKindSchema)))
-> ParamSchema 'SwaggerKindSchema
-> f (ParamSchema 'SwaggerKindSchema)
forall s a. HasType s a => Lens' s a
type_
instance HasType ParamOtherSchema (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)) where type_ :: (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)
 -> f (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)))
-> ParamOtherSchema -> f ParamOtherSchema
type_ = (ParamSchema 'SwaggerKindParamOtherSchema
 -> f (ParamSchema 'SwaggerKindParamOtherSchema))
-> ParamOtherSchema -> f ParamOtherSchema
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema 'SwaggerKindParamOtherSchema
  -> f (ParamSchema 'SwaggerKindParamOtherSchema))
 -> ParamOtherSchema -> f ParamOtherSchema)
-> ((Maybe (SwaggerType 'SwaggerKindParamOtherSchema)
     -> f (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)))
    -> ParamSchema 'SwaggerKindParamOtherSchema
    -> f (ParamSchema 'SwaggerKindParamOtherSchema))
-> (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)
    -> f (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)))
-> ParamOtherSchema
-> f ParamOtherSchema
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe (SwaggerType 'SwaggerKindParamOtherSchema)
 -> f (Maybe (SwaggerType 'SwaggerKindParamOtherSchema)))
-> ParamSchema 'SwaggerKindParamOtherSchema
-> f (ParamSchema 'SwaggerKindParamOtherSchema)
forall s a. HasType s a => Lens' s a
type_

-- HasDefault instances
instance HasDefault Header (Maybe Value) where default_ :: (Maybe Value -> f (Maybe Value)) -> Header -> f Header
default_ = (ParamSchema ('SwaggerKindNormal Header)
 -> f (ParamSchema ('SwaggerKindNormal Header)))
-> Header -> f Header
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema ('SwaggerKindNormal Header)
  -> f (ParamSchema ('SwaggerKindNormal Header)))
 -> Header -> f Header)
-> ((Maybe Value -> f (Maybe Value))
    -> ParamSchema ('SwaggerKindNormal Header)
    -> f (ParamSchema ('SwaggerKindNormal Header)))
-> (Maybe Value -> f (Maybe Value))
-> Header
-> f Header
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Value -> f (Maybe Value))
-> ParamSchema ('SwaggerKindNormal Header)
-> f (ParamSchema ('SwaggerKindNormal Header))
forall s a. HasDefault s a => Lens' s a
default_
instance HasDefault Schema (Maybe Value) where default_ :: (Maybe Value -> f (Maybe Value)) -> Schema -> f Schema
default_ = (ParamSchema 'SwaggerKindSchema
 -> f (ParamSchema 'SwaggerKindSchema))
-> Schema -> f Schema
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema 'SwaggerKindSchema
  -> f (ParamSchema 'SwaggerKindSchema))
 -> Schema -> f Schema)
-> ((Maybe Value -> f (Maybe Value))
    -> ParamSchema 'SwaggerKindSchema
    -> f (ParamSchema 'SwaggerKindSchema))
-> (Maybe Value -> f (Maybe Value))
-> Schema
-> f Schema
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Value -> f (Maybe Value))
-> ParamSchema 'SwaggerKindSchema
-> f (ParamSchema 'SwaggerKindSchema)
forall s a. HasDefault s a => Lens' s a
default_
instance HasDefault ParamOtherSchema (Maybe Value) where default_ :: (Maybe Value -> f (Maybe Value))
-> ParamOtherSchema -> f ParamOtherSchema
default_ = (ParamSchema 'SwaggerKindParamOtherSchema
 -> f (ParamSchema 'SwaggerKindParamOtherSchema))
-> ParamOtherSchema -> f ParamOtherSchema
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema 'SwaggerKindParamOtherSchema
  -> f (ParamSchema 'SwaggerKindParamOtherSchema))
 -> ParamOtherSchema -> f ParamOtherSchema)
-> ((Maybe Value -> f (Maybe Value))
    -> ParamSchema 'SwaggerKindParamOtherSchema
    -> f (ParamSchema 'SwaggerKindParamOtherSchema))
-> (Maybe Value -> f (Maybe Value))
-> ParamOtherSchema
-> f ParamOtherSchema
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Value -> f (Maybe Value))
-> ParamSchema 'SwaggerKindParamOtherSchema
-> f (ParamSchema 'SwaggerKindParamOtherSchema)
forall s a. HasDefault s a => Lens' s a
default_

-- OVERLAPPABLE instances

instance
  {-# OVERLAPPABLE #-}
  HasParamSchema s (ParamSchema t)
  => HasFormat s (Maybe Format) where
  format :: (Maybe Text -> f (Maybe Text)) -> s -> f s
format = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Text -> f (Maybe Text))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Text -> f (Maybe Text))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Text -> f (Maybe Text))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasFormat s a => Lens' s a
format

instance
  {-# OVERLAPPABLE #-}
  HasParamSchema s (ParamSchema t)
  => HasItems s (Maybe (SwaggerItems t)) where
  items :: (Maybe (SwaggerItems t) -> f (Maybe (SwaggerItems t))) -> s -> f s
items = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe (SwaggerItems t) -> f (Maybe (SwaggerItems t)))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe (SwaggerItems t) -> f (Maybe (SwaggerItems t)))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe (SwaggerItems t) -> f (Maybe (SwaggerItems t)))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasItems s a => Lens' s a
items

instance
  {-# OVERLAPPABLE #-}
  HasParamSchema s (ParamSchema t)
  => HasMaximum s (Maybe Scientific) where
  maximum_ :: (Maybe Scientific -> f (Maybe Scientific)) -> s -> f s
maximum_ = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Scientific -> f (Maybe Scientific))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Scientific -> f (Maybe Scientific))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Scientific -> f (Maybe Scientific))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMaximum s a => Lens' s a
maximum_

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasExclusiveMaximum s (Maybe Bool) where
  exclusiveMaximum :: (Maybe Bool -> f (Maybe Bool)) -> s -> f s
exclusiveMaximum = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Bool -> f (Maybe Bool))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Bool -> f (Maybe Bool))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Bool -> f (Maybe Bool))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasExclusiveMaximum s a => Lens' s a
exclusiveMaximum

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasMinimum s (Maybe Scientific) where
  minimum_ :: (Maybe Scientific -> f (Maybe Scientific)) -> s -> f s
minimum_ = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Scientific -> f (Maybe Scientific))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Scientific -> f (Maybe Scientific))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Scientific -> f (Maybe Scientific))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMinimum s a => Lens' s a
minimum_

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasExclusiveMinimum s (Maybe Bool) where
  exclusiveMinimum :: (Maybe Bool -> f (Maybe Bool)) -> s -> f s
exclusiveMinimum = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Bool -> f (Maybe Bool))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Bool -> f (Maybe Bool))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Bool -> f (Maybe Bool))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasExclusiveMinimum s a => Lens' s a
exclusiveMinimum

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasMaxLength s (Maybe Integer) where
  maxLength :: (Maybe Integer -> f (Maybe Integer)) -> s -> f s
maxLength = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Integer -> f (Maybe Integer))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Integer -> f (Maybe Integer))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Integer -> f (Maybe Integer))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMaxLength s a => Lens' s a
maxLength

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasMinLength s (Maybe Integer) where
  minLength :: (Maybe Integer -> f (Maybe Integer)) -> s -> f s
minLength = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Integer -> f (Maybe Integer))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Integer -> f (Maybe Integer))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Integer -> f (Maybe Integer))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMinLength s a => Lens' s a
minLength

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasPattern s (Maybe Text) where
  pattern :: (Maybe Text -> f (Maybe Text)) -> s -> f s
pattern = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Text -> f (Maybe Text))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Text -> f (Maybe Text))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Text -> f (Maybe Text))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasPattern s a => Lens' s a
pattern

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasMaxItems s (Maybe Integer) where
  maxItems :: (Maybe Integer -> f (Maybe Integer)) -> s -> f s
maxItems = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Integer -> f (Maybe Integer))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Integer -> f (Maybe Integer))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Integer -> f (Maybe Integer))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMaxItems s a => Lens' s a
maxItems

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasMinItems s (Maybe Integer) where
  minItems :: (Maybe Integer -> f (Maybe Integer)) -> s -> f s
minItems = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Integer -> f (Maybe Integer))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Integer -> f (Maybe Integer))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Integer -> f (Maybe Integer))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMinItems s a => Lens' s a
minItems

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasUniqueItems s (Maybe Bool) where
  uniqueItems :: (Maybe Bool -> f (Maybe Bool)) -> s -> f s
uniqueItems = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Bool -> f (Maybe Bool))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Bool -> f (Maybe Bool))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Bool -> f (Maybe Bool))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasUniqueItems s a => Lens' s a
uniqueItems

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasEnum s (Maybe [Value]) where
  enum_ :: (Maybe [Value] -> f (Maybe [Value])) -> s -> f s
enum_ = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe [Value] -> f (Maybe [Value]))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe [Value] -> f (Maybe [Value]))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe [Value] -> f (Maybe [Value]))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasEnum s a => Lens' s a
enum_

instance {-# OVERLAPPABLE #-} HasParamSchema s (ParamSchema t)
  => HasMultipleOf s (Maybe Scientific) where
  multipleOf :: (Maybe Scientific -> f (Maybe Scientific)) -> s -> f s
multipleOf = (ParamSchema t -> f (ParamSchema t)) -> s -> f s
forall s a. HasParamSchema s a => Lens' s a
paramSchema((ParamSchema t -> f (ParamSchema t)) -> s -> f s)
-> ((Maybe Scientific -> f (Maybe Scientific))
    -> ParamSchema t -> f (ParamSchema t))
-> (Maybe Scientific -> f (Maybe Scientific))
-> s
-> f s
forall b c a. (b -> c) -> (a -> b) -> a -> c
.(Maybe Scientific -> f (Maybe Scientific))
-> ParamSchema t -> f (ParamSchema t)
forall s a. HasMultipleOf s a => Lens' s a
multipleOf