{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Transfer.CreateServer
(
CreateServer (..),
newCreateServer,
createServer_loggingRole,
createServer_hostKey,
createServer_identityProviderType,
createServer_protocols,
createServer_domain,
createServer_endpointType,
createServer_securityPolicyName,
createServer_certificate,
createServer_identityProviderDetails,
createServer_workflowDetails,
createServer_tags,
createServer_endpointDetails,
CreateServerResponse (..),
newCreateServerResponse,
createServerResponse_httpStatus,
createServerResponse_serverId,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types
data CreateServer = CreateServer'
{
CreateServer -> Maybe Text
loggingRole :: Prelude.Maybe Prelude.Text,
CreateServer -> Maybe (Sensitive Text)
hostKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateServer -> Maybe IdentityProviderType
identityProviderType :: Prelude.Maybe IdentityProviderType,
CreateServer -> Maybe (NonEmpty Protocol)
protocols :: Prelude.Maybe (Prelude.NonEmpty Protocol),
CreateServer -> Maybe Domain
domain :: Prelude.Maybe Domain,
CreateServer -> Maybe EndpointType
endpointType :: Prelude.Maybe EndpointType,
CreateServer -> Maybe Text
securityPolicyName :: Prelude.Maybe Prelude.Text,
CreateServer -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
CreateServer -> Maybe IdentityProviderDetails
identityProviderDetails :: Prelude.Maybe IdentityProviderDetails,
CreateServer -> Maybe WorkflowDetails
workflowDetails :: Prelude.Maybe WorkflowDetails,
CreateServer -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
CreateServer -> Maybe EndpointDetails
endpointDetails :: Prelude.Maybe EndpointDetails
}
deriving (CreateServer -> CreateServer -> Bool
(CreateServer -> CreateServer -> Bool)
-> (CreateServer -> CreateServer -> Bool) -> Eq CreateServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateServer -> CreateServer -> Bool
$c/= :: CreateServer -> CreateServer -> Bool
== :: CreateServer -> CreateServer -> Bool
$c== :: CreateServer -> CreateServer -> Bool
Prelude.Eq, Int -> CreateServer -> ShowS
[CreateServer] -> ShowS
CreateServer -> String
(Int -> CreateServer -> ShowS)
-> (CreateServer -> String)
-> ([CreateServer] -> ShowS)
-> Show CreateServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateServer] -> ShowS
$cshowList :: [CreateServer] -> ShowS
show :: CreateServer -> String
$cshow :: CreateServer -> String
showsPrec :: Int -> CreateServer -> ShowS
$cshowsPrec :: Int -> CreateServer -> ShowS
Prelude.Show, (forall x. CreateServer -> Rep CreateServer x)
-> (forall x. Rep CreateServer x -> CreateServer)
-> Generic CreateServer
forall x. Rep CreateServer x -> CreateServer
forall x. CreateServer -> Rep CreateServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateServer x -> CreateServer
$cfrom :: forall x. CreateServer -> Rep CreateServer x
Prelude.Generic)
newCreateServer ::
CreateServer
newCreateServer :: CreateServer
newCreateServer =
CreateServer' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe IdentityProviderType
-> Maybe (NonEmpty Protocol)
-> Maybe Domain
-> Maybe EndpointType
-> Maybe Text
-> Maybe Text
-> Maybe IdentityProviderDetails
-> Maybe WorkflowDetails
-> Maybe (NonEmpty Tag)
-> Maybe EndpointDetails
-> CreateServer
CreateServer'
{ $sel:loggingRole:CreateServer' :: Maybe Text
loggingRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hostKey:CreateServer' :: Maybe (Sensitive Text)
hostKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:identityProviderType:CreateServer' :: Maybe IdentityProviderType
identityProviderType = Maybe IdentityProviderType
forall a. Maybe a
Prelude.Nothing,
$sel:protocols:CreateServer' :: Maybe (NonEmpty Protocol)
protocols = Maybe (NonEmpty Protocol)
forall a. Maybe a
Prelude.Nothing,
$sel:domain:CreateServer' :: Maybe Domain
domain = Maybe Domain
forall a. Maybe a
Prelude.Nothing,
$sel:endpointType:CreateServer' :: Maybe EndpointType
endpointType = Maybe EndpointType
forall a. Maybe a
Prelude.Nothing,
$sel:securityPolicyName:CreateServer' :: Maybe Text
securityPolicyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificate:CreateServer' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:identityProviderDetails:CreateServer' :: Maybe IdentityProviderDetails
identityProviderDetails = Maybe IdentityProviderDetails
forall a. Maybe a
Prelude.Nothing,
$sel:workflowDetails:CreateServer' :: Maybe WorkflowDetails
workflowDetails = Maybe WorkflowDetails
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateServer' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
$sel:endpointDetails:CreateServer' :: Maybe EndpointDetails
endpointDetails = Maybe EndpointDetails
forall a. Maybe a
Prelude.Nothing
}
createServer_loggingRole :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_loggingRole :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_loggingRole = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
loggingRole :: Maybe Text
$sel:loggingRole:CreateServer' :: CreateServer -> Maybe Text
loggingRole} -> Maybe Text
loggingRole) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:loggingRole:CreateServer' :: Maybe Text
loggingRole = Maybe Text
a} :: CreateServer)
createServer_hostKey :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_hostKey :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_hostKey = (CreateServer -> Maybe (Sensitive Text))
-> (CreateServer -> Maybe (Sensitive Text) -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe (Sensitive Text)
hostKey :: Maybe (Sensitive Text)
$sel:hostKey:CreateServer' :: CreateServer -> Maybe (Sensitive Text)
hostKey} -> Maybe (Sensitive Text)
hostKey) (\s :: CreateServer
s@CreateServer' {} Maybe (Sensitive Text)
a -> CreateServer
s {$sel:hostKey:CreateServer' :: Maybe (Sensitive Text)
hostKey = Maybe (Sensitive Text)
a} :: CreateServer) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateServer -> f CreateServer)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateServer
-> f CreateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
createServer_identityProviderType :: Lens.Lens' CreateServer (Prelude.Maybe IdentityProviderType)
createServer_identityProviderType :: (Maybe IdentityProviderType -> f (Maybe IdentityProviderType))
-> CreateServer -> f CreateServer
createServer_identityProviderType = (CreateServer -> Maybe IdentityProviderType)
-> (CreateServer -> Maybe IdentityProviderType -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe IdentityProviderType)
(Maybe IdentityProviderType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe IdentityProviderType
identityProviderType :: Maybe IdentityProviderType
$sel:identityProviderType:CreateServer' :: CreateServer -> Maybe IdentityProviderType
identityProviderType} -> Maybe IdentityProviderType
identityProviderType) (\s :: CreateServer
s@CreateServer' {} Maybe IdentityProviderType
a -> CreateServer
s {$sel:identityProviderType:CreateServer' :: Maybe IdentityProviderType
identityProviderType = Maybe IdentityProviderType
a} :: CreateServer)
createServer_protocols :: Lens.Lens' CreateServer (Prelude.Maybe (Prelude.NonEmpty Protocol))
createServer_protocols :: (Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> CreateServer -> f CreateServer
createServer_protocols = (CreateServer -> Maybe (NonEmpty Protocol))
-> (CreateServer -> Maybe (NonEmpty Protocol) -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe (NonEmpty Protocol))
(Maybe (NonEmpty Protocol))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe (NonEmpty Protocol)
protocols :: Maybe (NonEmpty Protocol)
$sel:protocols:CreateServer' :: CreateServer -> Maybe (NonEmpty Protocol)
protocols} -> Maybe (NonEmpty Protocol)
protocols) (\s :: CreateServer
s@CreateServer' {} Maybe (NonEmpty Protocol)
a -> CreateServer
s {$sel:protocols:CreateServer' :: Maybe (NonEmpty Protocol)
protocols = Maybe (NonEmpty Protocol)
a} :: CreateServer) ((Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> CreateServer -> f CreateServer)
-> ((Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> (Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> CreateServer
-> f CreateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Protocol)
(NonEmpty Protocol)
(NonEmpty Protocol)
(NonEmpty Protocol)
-> Iso
(Maybe (NonEmpty Protocol))
(Maybe (NonEmpty Protocol))
(Maybe (NonEmpty Protocol))
(Maybe (NonEmpty Protocol))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty Protocol)
(NonEmpty Protocol)
(NonEmpty Protocol)
(NonEmpty Protocol)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createServer_domain :: Lens.Lens' CreateServer (Prelude.Maybe Domain)
createServer_domain :: (Maybe Domain -> f (Maybe Domain))
-> CreateServer -> f CreateServer
createServer_domain = (CreateServer -> Maybe Domain)
-> (CreateServer -> Maybe Domain -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Domain) (Maybe Domain)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Domain
domain :: Maybe Domain
$sel:domain:CreateServer' :: CreateServer -> Maybe Domain
domain} -> Maybe Domain
domain) (\s :: CreateServer
s@CreateServer' {} Maybe Domain
a -> CreateServer
s {$sel:domain:CreateServer' :: Maybe Domain
domain = Maybe Domain
a} :: CreateServer)
createServer_endpointType :: Lens.Lens' CreateServer (Prelude.Maybe EndpointType)
createServer_endpointType :: (Maybe EndpointType -> f (Maybe EndpointType))
-> CreateServer -> f CreateServer
createServer_endpointType = (CreateServer -> Maybe EndpointType)
-> (CreateServer -> Maybe EndpointType -> CreateServer)
-> Lens
CreateServer CreateServer (Maybe EndpointType) (Maybe EndpointType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe EndpointType
endpointType :: Maybe EndpointType
$sel:endpointType:CreateServer' :: CreateServer -> Maybe EndpointType
endpointType} -> Maybe EndpointType
endpointType) (\s :: CreateServer
s@CreateServer' {} Maybe EndpointType
a -> CreateServer
s {$sel:endpointType:CreateServer' :: Maybe EndpointType
endpointType = Maybe EndpointType
a} :: CreateServer)
createServer_securityPolicyName :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_securityPolicyName :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_securityPolicyName = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
securityPolicyName :: Maybe Text
$sel:securityPolicyName:CreateServer' :: CreateServer -> Maybe Text
securityPolicyName} -> Maybe Text
securityPolicyName) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:securityPolicyName:CreateServer' :: Maybe Text
securityPolicyName = Maybe Text
a} :: CreateServer)
createServer_certificate :: Lens.Lens' CreateServer (Prelude.Maybe Prelude.Text)
createServer_certificate :: (Maybe Text -> f (Maybe Text)) -> CreateServer -> f CreateServer
createServer_certificate = (CreateServer -> Maybe Text)
-> (CreateServer -> Maybe Text -> CreateServer)
-> Lens CreateServer CreateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe Text
certificate :: Maybe Text
$sel:certificate:CreateServer' :: CreateServer -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: CreateServer
s@CreateServer' {} Maybe Text
a -> CreateServer
s {$sel:certificate:CreateServer' :: Maybe Text
certificate = Maybe Text
a} :: CreateServer)
createServer_identityProviderDetails :: Lens.Lens' CreateServer (Prelude.Maybe IdentityProviderDetails)
createServer_identityProviderDetails :: (Maybe IdentityProviderDetails
-> f (Maybe IdentityProviderDetails))
-> CreateServer -> f CreateServer
createServer_identityProviderDetails = (CreateServer -> Maybe IdentityProviderDetails)
-> (CreateServer -> Maybe IdentityProviderDetails -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe IdentityProviderDetails)
(Maybe IdentityProviderDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe IdentityProviderDetails
identityProviderDetails :: Maybe IdentityProviderDetails
$sel:identityProviderDetails:CreateServer' :: CreateServer -> Maybe IdentityProviderDetails
identityProviderDetails} -> Maybe IdentityProviderDetails
identityProviderDetails) (\s :: CreateServer
s@CreateServer' {} Maybe IdentityProviderDetails
a -> CreateServer
s {$sel:identityProviderDetails:CreateServer' :: Maybe IdentityProviderDetails
identityProviderDetails = Maybe IdentityProviderDetails
a} :: CreateServer)
createServer_workflowDetails :: Lens.Lens' CreateServer (Prelude.Maybe WorkflowDetails)
createServer_workflowDetails :: (Maybe WorkflowDetails -> f (Maybe WorkflowDetails))
-> CreateServer -> f CreateServer
createServer_workflowDetails = (CreateServer -> Maybe WorkflowDetails)
-> (CreateServer -> Maybe WorkflowDetails -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe WorkflowDetails)
(Maybe WorkflowDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe WorkflowDetails
workflowDetails :: Maybe WorkflowDetails
$sel:workflowDetails:CreateServer' :: CreateServer -> Maybe WorkflowDetails
workflowDetails} -> Maybe WorkflowDetails
workflowDetails) (\s :: CreateServer
s@CreateServer' {} Maybe WorkflowDetails
a -> CreateServer
s {$sel:workflowDetails:CreateServer' :: Maybe WorkflowDetails
workflowDetails = Maybe WorkflowDetails
a} :: CreateServer)
createServer_tags :: Lens.Lens' CreateServer (Prelude.Maybe (Prelude.NonEmpty Tag))
createServer_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateServer -> f CreateServer
createServer_tags = (CreateServer -> Maybe (NonEmpty Tag))
-> (CreateServer -> Maybe (NonEmpty Tag) -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateServer' :: CreateServer -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateServer
s@CreateServer' {} Maybe (NonEmpty Tag)
a -> CreateServer
s {$sel:tags:CreateServer' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateServer) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateServer -> f CreateServer)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateServer
-> f CreateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
(Maybe (NonEmpty Tag))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createServer_endpointDetails :: Lens.Lens' CreateServer (Prelude.Maybe EndpointDetails)
createServer_endpointDetails :: (Maybe EndpointDetails -> f (Maybe EndpointDetails))
-> CreateServer -> f CreateServer
createServer_endpointDetails = (CreateServer -> Maybe EndpointDetails)
-> (CreateServer -> Maybe EndpointDetails -> CreateServer)
-> Lens
CreateServer
CreateServer
(Maybe EndpointDetails)
(Maybe EndpointDetails)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServer' {Maybe EndpointDetails
endpointDetails :: Maybe EndpointDetails
$sel:endpointDetails:CreateServer' :: CreateServer -> Maybe EndpointDetails
endpointDetails} -> Maybe EndpointDetails
endpointDetails) (\s :: CreateServer
s@CreateServer' {} Maybe EndpointDetails
a -> CreateServer
s {$sel:endpointDetails:CreateServer' :: Maybe EndpointDetails
endpointDetails = Maybe EndpointDetails
a} :: CreateServer)
instance Core.AWSRequest CreateServer where
type AWSResponse CreateServer = CreateServerResponse
request :: CreateServer -> Request CreateServer
request = Service -> CreateServer -> Request CreateServer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateServer)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateServer))
-> Logger
-> Service
-> Proxy CreateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateServer)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Text -> CreateServerResponse
CreateServerResponse'
(Int -> Text -> CreateServerResponse)
-> Either String Int
-> Either String (Text -> CreateServerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either String (Text -> CreateServerResponse)
-> Either String Text -> Either String CreateServerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ServerId")
)
instance Prelude.Hashable CreateServer
instance Prelude.NFData CreateServer
instance Core.ToHeaders CreateServer where
toHeaders :: CreateServer -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateServer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"TransferService.CreateServer" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON CreateServer where
toJSON :: CreateServer -> Value
toJSON CreateServer' {Maybe (NonEmpty Protocol)
Maybe (NonEmpty Tag)
Maybe Text
Maybe (Sensitive Text)
Maybe Domain
Maybe EndpointDetails
Maybe EndpointType
Maybe IdentityProviderDetails
Maybe IdentityProviderType
Maybe WorkflowDetails
endpointDetails :: Maybe EndpointDetails
tags :: Maybe (NonEmpty Tag)
workflowDetails :: Maybe WorkflowDetails
identityProviderDetails :: Maybe IdentityProviderDetails
certificate :: Maybe Text
securityPolicyName :: Maybe Text
endpointType :: Maybe EndpointType
domain :: Maybe Domain
protocols :: Maybe (NonEmpty Protocol)
identityProviderType :: Maybe IdentityProviderType
hostKey :: Maybe (Sensitive Text)
loggingRole :: Maybe Text
$sel:endpointDetails:CreateServer' :: CreateServer -> Maybe EndpointDetails
$sel:tags:CreateServer' :: CreateServer -> Maybe (NonEmpty Tag)
$sel:workflowDetails:CreateServer' :: CreateServer -> Maybe WorkflowDetails
$sel:identityProviderDetails:CreateServer' :: CreateServer -> Maybe IdentityProviderDetails
$sel:certificate:CreateServer' :: CreateServer -> Maybe Text
$sel:securityPolicyName:CreateServer' :: CreateServer -> Maybe Text
$sel:endpointType:CreateServer' :: CreateServer -> Maybe EndpointType
$sel:domain:CreateServer' :: CreateServer -> Maybe Domain
$sel:protocols:CreateServer' :: CreateServer -> Maybe (NonEmpty Protocol)
$sel:identityProviderType:CreateServer' :: CreateServer -> Maybe IdentityProviderType
$sel:hostKey:CreateServer' :: CreateServer -> Maybe (Sensitive Text)
$sel:loggingRole:CreateServer' :: CreateServer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LoggingRole" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
loggingRole,
(Text
"HostKey" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
hostKey,
(Text
"IdentityProviderType" Text -> IdentityProviderType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IdentityProviderType -> Pair)
-> Maybe IdentityProviderType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IdentityProviderType
identityProviderType,
(Text
"Protocols" Text -> NonEmpty Protocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Protocol -> Pair)
-> Maybe (NonEmpty Protocol) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Protocol)
protocols,
(Text
"Domain" Text -> Domain -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Domain -> Pair) -> Maybe Domain -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Domain
domain,
(Text
"EndpointType" Text -> EndpointType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EndpointType -> Pair) -> Maybe EndpointType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointType
endpointType,
(Text
"SecurityPolicyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
securityPolicyName,
(Text
"Certificate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificate,
(Text
"IdentityProviderDetails" Text -> IdentityProviderDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(IdentityProviderDetails -> Pair)
-> Maybe IdentityProviderDetails -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IdentityProviderDetails
identityProviderDetails,
(Text
"WorkflowDetails" Text -> WorkflowDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(WorkflowDetails -> Pair) -> Maybe WorkflowDetails -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WorkflowDetails
workflowDetails,
(Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
(Text
"EndpointDetails" Text -> EndpointDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EndpointDetails -> Pair) -> Maybe EndpointDetails -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointDetails
endpointDetails
]
)
instance Core.ToPath CreateServer where
toPath :: CreateServer -> ByteString
toPath = ByteString -> CreateServer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateServer where
toQuery :: CreateServer -> QueryString
toQuery = QueryString -> CreateServer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateServerResponse = CreateServerResponse'
{
CreateServerResponse -> Int
httpStatus :: Prelude.Int,
CreateServerResponse -> Text
serverId :: Prelude.Text
}
deriving (CreateServerResponse -> CreateServerResponse -> Bool
(CreateServerResponse -> CreateServerResponse -> Bool)
-> (CreateServerResponse -> CreateServerResponse -> Bool)
-> Eq CreateServerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateServerResponse -> CreateServerResponse -> Bool
$c/= :: CreateServerResponse -> CreateServerResponse -> Bool
== :: CreateServerResponse -> CreateServerResponse -> Bool
$c== :: CreateServerResponse -> CreateServerResponse -> Bool
Prelude.Eq, ReadPrec [CreateServerResponse]
ReadPrec CreateServerResponse
Int -> ReadS CreateServerResponse
ReadS [CreateServerResponse]
(Int -> ReadS CreateServerResponse)
-> ReadS [CreateServerResponse]
-> ReadPrec CreateServerResponse
-> ReadPrec [CreateServerResponse]
-> Read CreateServerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateServerResponse]
$creadListPrec :: ReadPrec [CreateServerResponse]
readPrec :: ReadPrec CreateServerResponse
$creadPrec :: ReadPrec CreateServerResponse
readList :: ReadS [CreateServerResponse]
$creadList :: ReadS [CreateServerResponse]
readsPrec :: Int -> ReadS CreateServerResponse
$creadsPrec :: Int -> ReadS CreateServerResponse
Prelude.Read, Int -> CreateServerResponse -> ShowS
[CreateServerResponse] -> ShowS
CreateServerResponse -> String
(Int -> CreateServerResponse -> ShowS)
-> (CreateServerResponse -> String)
-> ([CreateServerResponse] -> ShowS)
-> Show CreateServerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateServerResponse] -> ShowS
$cshowList :: [CreateServerResponse] -> ShowS
show :: CreateServerResponse -> String
$cshow :: CreateServerResponse -> String
showsPrec :: Int -> CreateServerResponse -> ShowS
$cshowsPrec :: Int -> CreateServerResponse -> ShowS
Prelude.Show, (forall x. CreateServerResponse -> Rep CreateServerResponse x)
-> (forall x. Rep CreateServerResponse x -> CreateServerResponse)
-> Generic CreateServerResponse
forall x. Rep CreateServerResponse x -> CreateServerResponse
forall x. CreateServerResponse -> Rep CreateServerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateServerResponse x -> CreateServerResponse
$cfrom :: forall x. CreateServerResponse -> Rep CreateServerResponse x
Prelude.Generic)
newCreateServerResponse ::
Prelude.Int ->
Prelude.Text ->
CreateServerResponse
newCreateServerResponse :: Int -> Text -> CreateServerResponse
newCreateServerResponse Int
pHttpStatus_ Text
pServerId_ =
CreateServerResponse' :: Int -> Text -> CreateServerResponse
CreateServerResponse'
{ $sel:httpStatus:CreateServerResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:serverId:CreateServerResponse' :: Text
serverId = Text
pServerId_
}
createServerResponse_httpStatus :: Lens.Lens' CreateServerResponse Prelude.Int
createServerResponse_httpStatus :: (Int -> f Int) -> CreateServerResponse -> f CreateServerResponse
createServerResponse_httpStatus = (CreateServerResponse -> Int)
-> (CreateServerResponse -> Int -> CreateServerResponse)
-> Lens CreateServerResponse CreateServerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServerResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateServerResponse' :: CreateServerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateServerResponse
s@CreateServerResponse' {} Int
a -> CreateServerResponse
s {$sel:httpStatus:CreateServerResponse' :: Int
httpStatus = Int
a} :: CreateServerResponse)
createServerResponse_serverId :: Lens.Lens' CreateServerResponse Prelude.Text
createServerResponse_serverId :: (Text -> f Text) -> CreateServerResponse -> f CreateServerResponse
createServerResponse_serverId = (CreateServerResponse -> Text)
-> (CreateServerResponse -> Text -> CreateServerResponse)
-> Lens CreateServerResponse CreateServerResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateServerResponse' {Text
serverId :: Text
$sel:serverId:CreateServerResponse' :: CreateServerResponse -> Text
serverId} -> Text
serverId) (\s :: CreateServerResponse
s@CreateServerResponse' {} Text
a -> CreateServerResponse
s {$sel:serverId:CreateServerResponse' :: Text
serverId = Text
a} :: CreateServerResponse)
instance Prelude.NFData CreateServerResponse