-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathCreateUsersWithArrayInput.hs
More file actions
executable file
·94 lines (90 loc) · 6.96 KB
/
CreateUsersWithArrayInput.hs
File metadata and controls
executable file
·94 lines (90 loc) · 6.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
-- | Contains the different functions to run the operation createUsersWithArrayInput
module OpenAPI.Operations.CreateUsersWithArrayInput where
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
import qualified Prelude as GHC.Internal.Maybe
import qualified Control.Monad.Fail
import qualified Control.Monad.Fail as GHC.Internal.Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Decoding
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.ByteString as Data.ByteString.Internal.Type
import qualified Data.Either
import qualified Data.Either as GHC.Internal.Data.Either
import qualified Data.Foldable
import qualified Data.Foldable as GHC.Internal.Data.Foldable
import qualified Data.Functor
import qualified Data.Functor as GHC.Internal.Data.Functor
import qualified Data.Maybe
import qualified Data.Maybe as GHC.Internal.Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
import qualified GHC.Base
import qualified GHC.Base as GHC.Internal.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Int as GHC.Internal.Int
import qualified GHC.Show
import qualified GHC.Show as GHC.Internal.Show
import qualified GHC.Types
import qualified Network.HTTP.Client
import qualified Network.HTTP.Client as Network.HTTP.Client.Request
import qualified Network.HTTP.Client as Network.HTTP.Client.Types
import qualified Network.HTTP.Simple
import qualified Network.HTTP.Types
import qualified Network.HTTP.Types as Network.HTTP.Types.Status
import qualified Network.HTTP.Types as Network.HTTP.Types.URI
import qualified OpenAPI.Common
import OpenAPI.Types
-- | > POST /user/createWithArray
--
--
createUsersWithArrayInput :: forall m . OpenAPI.Common.MonadHTTP m => [User] -- ^ The request body to send
-> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response CreateUsersWithArrayInputResponse) -- ^ Monadic computation which returns the result of the operation
createUsersWithArrayInput body = GHC.Base.fmap (\response_0 -> GHC.Base.fmap (Data.Either.either CreateUsersWithArrayInputResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUsersWithArrayInputResponseDefault
| GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_0) response_0) (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON)
-- | Represents a response of the operation 'createUsersWithArrayInput'.
--
-- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'CreateUsersWithArrayInputResponseError' is used.
data CreateUsersWithArrayInputResponse =
CreateUsersWithArrayInputResponseError GHC.Base.String -- ^ Means either no matching case available or a parse error
| CreateUsersWithArrayInputResponseDefault -- ^ successful operation
deriving (GHC.Show.Show, GHC.Classes.Eq)
-- | > POST /user/createWithArray
--
-- The same as 'createUsersWithArrayInput' but accepts an explicit configuration.
createUsersWithArrayInputWithConfiguration :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request
-> [User] -- ^ The request body to send
-> m (Network.HTTP.Client.Types.Response CreateUsersWithArrayInputResponse) -- ^ Monadic computation which returns the result of the operation
createUsersWithArrayInputWithConfiguration config
body = GHC.Base.fmap (\response_1 -> GHC.Base.fmap (Data.Either.either CreateUsersWithArrayInputResponseError GHC.Base.id GHC.Base.. (\response body -> if | GHC.Base.const GHC.Types.True (Network.HTTP.Client.Types.responseStatus response) -> Data.Either.Right CreateUsersWithArrayInputResponseDefault
| GHC.Base.otherwise -> Data.Either.Left "Missing default response type") response_1) response_1) (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON)
-- | > POST /user/createWithArray
--
-- The same as 'createUsersWithArrayInput' but returns the raw 'Data.ByteString.ByteString'.
createUsersWithArrayInputRaw :: forall m . OpenAPI.Common.MonadHTTP m => [User] -- ^ The request body to send
-> OpenAPI.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation
createUsersWithArrayInputRaw body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfigurationM (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON)
-- | > POST /user/createWithArray
--
-- The same as 'createUsersWithArrayInput' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'.
createUsersWithArrayInputWithConfigurationRaw :: forall m . OpenAPI.Common.MonadHTTP m => OpenAPI.Common.Configuration -- ^ The configuration to use in the request
-> [User] -- ^ The request body to send
-> m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString) -- ^ Monadic computation which returns the result of the operation
createUsersWithArrayInputWithConfigurationRaw config
body = GHC.Base.id (OpenAPI.Common.doBodyCallWithConfiguration config (Data.Text.toUpper GHC.Base.$ Data.Text.Internal.pack "POST") "/user/createWithArray" GHC.Base.mempty (GHC.Maybe.Just body) OpenAPI.Common.RequestBodyEncodingJSON)