1-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
3{-# LANGUAGE OverloadedStrings #-}
4{-# LANGUAGE MultiWayIf #-}
6-- | Contains the types generated from the schema RegexBodyMatcher
7module MockServer.Types.RegexBodyMatcher where
9import qualified Prelude as GHC.Integer.Type
10import qualified Prelude as GHC.Maybe
11import qualified Control.Monad.Fail
12import qualified Data.Aeson
13import qualified Data.Aeson as Data.Aeson.Encoding.Internal
14import qualified Data.Aeson as Data.Aeson.Types
15import qualified Data.Aeson as Data.Aeson.Types.FromJSON
16import qualified Data.Aeson as Data.Aeson.Types.ToJSON
17import qualified Data.Aeson as Data.Aeson.Types.Internal
18import qualified Data.ByteString.Char8
19import qualified Data.ByteString.Char8 as Data.ByteString.Internal
20import qualified Data.Foldable
21import qualified Data.Functor
22import qualified Data.Maybe
23import qualified Data.Scientific
24import qualified Data.Text
25import qualified Data.Text.Internal
26import qualified Data.Time.Calendar as Data.Time.Calendar.Days
27import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
28import qualified GHC.Base
29import qualified GHC.Classes
30import qualified GHC.Int
31import qualified GHC.Show
32import qualified GHC.Types
33import qualified MockServer.Common
34import MockServer.TypeAlias
36-- | Defines the object schema located at @components.schemas.RegexBodyMatcher@ in the specification.
39data RegexBodyMatcher = RegexBodyMatcher {
41 regexBodyMatcherNot :: (GHC.Maybe.Maybe GHC.Types.Bool)
43 , regexBodyMatcherRegex :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
45 , regexBodyMatcherType :: (GHC.Maybe.Maybe RegexBodyMatcherType)
46 } deriving (GHC.Show.Show
48instance Data.Aeson.Types.ToJSON.ToJSON RegexBodyMatcher
49 where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("not" Data.Aeson.Types.ToJSON..=)) (regexBodyMatcherNot obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("regex" Data.Aeson.Types.ToJSON..=)) (regexBodyMatcherRegex obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (regexBodyMatcherType obj) : GHC.Base.mempty))
50 toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("not" Data.Aeson.Types.ToJSON..=)) (regexBodyMatcherNot obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("regex" Data.Aeson.Types.ToJSON..=)) (regexBodyMatcherRegex obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("type" Data.Aeson.Types.ToJSON..=)) (regexBodyMatcherType obj) : GHC.Base.mempty)))
51instance Data.Aeson.Types.FromJSON.FromJSON RegexBodyMatcher
52 where parseJSON = Data.Aeson.Types.FromJSON.withObject "RegexBodyMatcher" (\obj -> ((GHC.Base.pure RegexBodyMatcher GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "not")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "regex")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "type"))
53-- | Create a new 'RegexBodyMatcher' with all required fields.
54mkRegexBodyMatcher :: RegexBodyMatcher
55mkRegexBodyMatcher = RegexBodyMatcher{regexBodyMatcherNot = GHC.Maybe.Nothing,
56 regexBodyMatcherRegex = GHC.Maybe.Nothing,
57 regexBodyMatcherType = GHC.Maybe.Nothing}
58-- | Defines the enum schema located at @components.schemas.RegexBodyMatcher.properties.type@ in the specification.
61data RegexBodyMatcherType =
62 RegexBodyMatcherTypeOther Data.Aeson.Types.Internal.Value -- ^ This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
63 | RegexBodyMatcherTypeTyped Data.Aeson.Types.Internal.Object -- ^ This constructor can be used to send values to the server which are not present in the specification yet.
64 | RegexBodyMatcherTypeEnumREGEX -- ^ Represents the JSON value @"REGEX"@
65 deriving (GHC.Show.Show, GHC.Classes.Eq)
66instance Data.Aeson.Types.ToJSON.ToJSON RegexBodyMatcherType
67 where toJSON (RegexBodyMatcherTypeOther val) = val
68 toJSON (RegexBodyMatcherTypeTyped val) = Data.Aeson.Types.ToJSON.toJSON val
69 toJSON (RegexBodyMatcherTypeEnumREGEX) = "REGEX"
70instance Data.Aeson.Types.FromJSON.FromJSON RegexBodyMatcherType
71 where parseJSON val = GHC.Base.pure (if | val GHC.Classes.== "REGEX" -> RegexBodyMatcherTypeEnumREGEX
72 | GHC.Base.otherwise -> RegexBodyMatcherTypeOther val)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list