{-# 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.CodeDeploy.RegisterOnPremisesInstance
(
RegisterOnPremisesInstance (..),
newRegisterOnPremisesInstance,
registerOnPremisesInstance_iamUserArn,
registerOnPremisesInstance_iamSessionArn,
registerOnPremisesInstance_instanceName,
RegisterOnPremisesInstanceResponse (..),
newRegisterOnPremisesInstanceResponse,
)
where
import Amazonka.CodeDeploy.Types
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
data RegisterOnPremisesInstance = RegisterOnPremisesInstance'
{
RegisterOnPremisesInstance -> Maybe Text
iamUserArn :: Prelude.Maybe Prelude.Text,
RegisterOnPremisesInstance -> Maybe Text
iamSessionArn :: Prelude.Maybe Prelude.Text,
RegisterOnPremisesInstance -> Text
instanceName :: Prelude.Text
}
deriving (RegisterOnPremisesInstance -> RegisterOnPremisesInstance -> Bool
(RegisterOnPremisesInstance -> RegisterOnPremisesInstance -> Bool)
-> (RegisterOnPremisesInstance
-> RegisterOnPremisesInstance -> Bool)
-> Eq RegisterOnPremisesInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterOnPremisesInstance -> RegisterOnPremisesInstance -> Bool
$c/= :: RegisterOnPremisesInstance -> RegisterOnPremisesInstance -> Bool
== :: RegisterOnPremisesInstance -> RegisterOnPremisesInstance -> Bool
$c== :: RegisterOnPremisesInstance -> RegisterOnPremisesInstance -> Bool
Prelude.Eq, ReadPrec [RegisterOnPremisesInstance]
ReadPrec RegisterOnPremisesInstance
Int -> ReadS RegisterOnPremisesInstance
ReadS [RegisterOnPremisesInstance]
(Int -> ReadS RegisterOnPremisesInstance)
-> ReadS [RegisterOnPremisesInstance]
-> ReadPrec RegisterOnPremisesInstance
-> ReadPrec [RegisterOnPremisesInstance]
-> Read RegisterOnPremisesInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterOnPremisesInstance]
$creadListPrec :: ReadPrec [RegisterOnPremisesInstance]
readPrec :: ReadPrec RegisterOnPremisesInstance
$creadPrec :: ReadPrec RegisterOnPremisesInstance
readList :: ReadS [RegisterOnPremisesInstance]
$creadList :: ReadS [RegisterOnPremisesInstance]
readsPrec :: Int -> ReadS RegisterOnPremisesInstance
$creadsPrec :: Int -> ReadS RegisterOnPremisesInstance
Prelude.Read, Int -> RegisterOnPremisesInstance -> ShowS
[RegisterOnPremisesInstance] -> ShowS
RegisterOnPremisesInstance -> String
(Int -> RegisterOnPremisesInstance -> ShowS)
-> (RegisterOnPremisesInstance -> String)
-> ([RegisterOnPremisesInstance] -> ShowS)
-> Show RegisterOnPremisesInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterOnPremisesInstance] -> ShowS
$cshowList :: [RegisterOnPremisesInstance] -> ShowS
show :: RegisterOnPremisesInstance -> String
$cshow :: RegisterOnPremisesInstance -> String
showsPrec :: Int -> RegisterOnPremisesInstance -> ShowS
$cshowsPrec :: Int -> RegisterOnPremisesInstance -> ShowS
Prelude.Show, (forall x.
RegisterOnPremisesInstance -> Rep RegisterOnPremisesInstance x)
-> (forall x.
Rep RegisterOnPremisesInstance x -> RegisterOnPremisesInstance)
-> Generic RegisterOnPremisesInstance
forall x.
Rep RegisterOnPremisesInstance x -> RegisterOnPremisesInstance
forall x.
RegisterOnPremisesInstance -> Rep RegisterOnPremisesInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterOnPremisesInstance x -> RegisterOnPremisesInstance
$cfrom :: forall x.
RegisterOnPremisesInstance -> Rep RegisterOnPremisesInstance x
Prelude.Generic)
newRegisterOnPremisesInstance ::
Prelude.Text ->
RegisterOnPremisesInstance
newRegisterOnPremisesInstance :: Text -> RegisterOnPremisesInstance
newRegisterOnPremisesInstance Text
pInstanceName_ =
RegisterOnPremisesInstance' :: Maybe Text -> Maybe Text -> Text -> RegisterOnPremisesInstance
RegisterOnPremisesInstance'
{ $sel:iamUserArn:RegisterOnPremisesInstance' :: Maybe Text
iamUserArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:iamSessionArn:RegisterOnPremisesInstance' :: Maybe Text
iamSessionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceName:RegisterOnPremisesInstance' :: Text
instanceName = Text
pInstanceName_
}
registerOnPremisesInstance_iamUserArn :: Lens.Lens' RegisterOnPremisesInstance (Prelude.Maybe Prelude.Text)
registerOnPremisesInstance_iamUserArn :: (Maybe Text -> f (Maybe Text))
-> RegisterOnPremisesInstance -> f RegisterOnPremisesInstance
registerOnPremisesInstance_iamUserArn = (RegisterOnPremisesInstance -> Maybe Text)
-> (RegisterOnPremisesInstance
-> Maybe Text -> RegisterOnPremisesInstance)
-> Lens
RegisterOnPremisesInstance
RegisterOnPremisesInstance
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterOnPremisesInstance' {Maybe Text
iamUserArn :: Maybe Text
$sel:iamUserArn:RegisterOnPremisesInstance' :: RegisterOnPremisesInstance -> Maybe Text
iamUserArn} -> Maybe Text
iamUserArn) (\s :: RegisterOnPremisesInstance
s@RegisterOnPremisesInstance' {} Maybe Text
a -> RegisterOnPremisesInstance
s {$sel:iamUserArn:RegisterOnPremisesInstance' :: Maybe Text
iamUserArn = Maybe Text
a} :: RegisterOnPremisesInstance)
registerOnPremisesInstance_iamSessionArn :: Lens.Lens' RegisterOnPremisesInstance (Prelude.Maybe Prelude.Text)
registerOnPremisesInstance_iamSessionArn :: (Maybe Text -> f (Maybe Text))
-> RegisterOnPremisesInstance -> f RegisterOnPremisesInstance
registerOnPremisesInstance_iamSessionArn = (RegisterOnPremisesInstance -> Maybe Text)
-> (RegisterOnPremisesInstance
-> Maybe Text -> RegisterOnPremisesInstance)
-> Lens
RegisterOnPremisesInstance
RegisterOnPremisesInstance
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterOnPremisesInstance' {Maybe Text
iamSessionArn :: Maybe Text
$sel:iamSessionArn:RegisterOnPremisesInstance' :: RegisterOnPremisesInstance -> Maybe Text
iamSessionArn} -> Maybe Text
iamSessionArn) (\s :: RegisterOnPremisesInstance
s@RegisterOnPremisesInstance' {} Maybe Text
a -> RegisterOnPremisesInstance
s {$sel:iamSessionArn:RegisterOnPremisesInstance' :: Maybe Text
iamSessionArn = Maybe Text
a} :: RegisterOnPremisesInstance)
registerOnPremisesInstance_instanceName :: Lens.Lens' RegisterOnPremisesInstance Prelude.Text
registerOnPremisesInstance_instanceName :: (Text -> f Text)
-> RegisterOnPremisesInstance -> f RegisterOnPremisesInstance
registerOnPremisesInstance_instanceName = (RegisterOnPremisesInstance -> Text)
-> (RegisterOnPremisesInstance
-> Text -> RegisterOnPremisesInstance)
-> Lens
RegisterOnPremisesInstance RegisterOnPremisesInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterOnPremisesInstance' {Text
instanceName :: Text
$sel:instanceName:RegisterOnPremisesInstance' :: RegisterOnPremisesInstance -> Text
instanceName} -> Text
instanceName) (\s :: RegisterOnPremisesInstance
s@RegisterOnPremisesInstance' {} Text
a -> RegisterOnPremisesInstance
s {$sel:instanceName:RegisterOnPremisesInstance' :: Text
instanceName = Text
a} :: RegisterOnPremisesInstance)
instance Core.AWSRequest RegisterOnPremisesInstance where
type
AWSResponse RegisterOnPremisesInstance =
RegisterOnPremisesInstanceResponse
request :: RegisterOnPremisesInstance -> Request RegisterOnPremisesInstance
request = Service
-> RegisterOnPremisesInstance -> Request RegisterOnPremisesInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterOnPremisesInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterOnPremisesInstance)))
response =
AWSResponse RegisterOnPremisesInstance
-> Logger
-> Service
-> Proxy RegisterOnPremisesInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterOnPremisesInstance)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RegisterOnPremisesInstance
RegisterOnPremisesInstanceResponse
RegisterOnPremisesInstanceResponse'
instance Prelude.Hashable RegisterOnPremisesInstance
instance Prelude.NFData RegisterOnPremisesInstance
instance Core.ToHeaders RegisterOnPremisesInstance where
toHeaders :: RegisterOnPremisesInstance -> [Header]
toHeaders =
[Header] -> RegisterOnPremisesInstance -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"CodeDeploy_20141006.RegisterOnPremisesInstance" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RegisterOnPremisesInstance where
toJSON :: RegisterOnPremisesInstance -> Value
toJSON RegisterOnPremisesInstance' {Maybe Text
Text
instanceName :: Text
iamSessionArn :: Maybe Text
iamUserArn :: Maybe Text
$sel:instanceName:RegisterOnPremisesInstance' :: RegisterOnPremisesInstance -> Text
$sel:iamSessionArn:RegisterOnPremisesInstance' :: RegisterOnPremisesInstance -> Maybe Text
$sel:iamUserArn:RegisterOnPremisesInstance' :: RegisterOnPremisesInstance -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"iamUserArn" 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
iamUserArn,
(Text
"iamSessionArn" 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
iamSessionArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"instanceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceName)
]
)
instance Core.ToPath RegisterOnPremisesInstance where
toPath :: RegisterOnPremisesInstance -> ByteString
toPath = ByteString -> RegisterOnPremisesInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterOnPremisesInstance where
toQuery :: RegisterOnPremisesInstance -> QueryString
toQuery = QueryString -> RegisterOnPremisesInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RegisterOnPremisesInstanceResponse = RegisterOnPremisesInstanceResponse'
{
}
deriving (RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool
(RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool)
-> (RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool)
-> Eq RegisterOnPremisesInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool
$c/= :: RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool
== :: RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool
$c== :: RegisterOnPremisesInstanceResponse
-> RegisterOnPremisesInstanceResponse -> Bool
Prelude.Eq, ReadPrec [RegisterOnPremisesInstanceResponse]
ReadPrec RegisterOnPremisesInstanceResponse
Int -> ReadS RegisterOnPremisesInstanceResponse
ReadS [RegisterOnPremisesInstanceResponse]
(Int -> ReadS RegisterOnPremisesInstanceResponse)
-> ReadS [RegisterOnPremisesInstanceResponse]
-> ReadPrec RegisterOnPremisesInstanceResponse
-> ReadPrec [RegisterOnPremisesInstanceResponse]
-> Read RegisterOnPremisesInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterOnPremisesInstanceResponse]
$creadListPrec :: ReadPrec [RegisterOnPremisesInstanceResponse]
readPrec :: ReadPrec RegisterOnPremisesInstanceResponse
$creadPrec :: ReadPrec RegisterOnPremisesInstanceResponse
readList :: ReadS [RegisterOnPremisesInstanceResponse]
$creadList :: ReadS [RegisterOnPremisesInstanceResponse]
readsPrec :: Int -> ReadS RegisterOnPremisesInstanceResponse
$creadsPrec :: Int -> ReadS RegisterOnPremisesInstanceResponse
Prelude.Read, Int -> RegisterOnPremisesInstanceResponse -> ShowS
[RegisterOnPremisesInstanceResponse] -> ShowS
RegisterOnPremisesInstanceResponse -> String
(Int -> RegisterOnPremisesInstanceResponse -> ShowS)
-> (RegisterOnPremisesInstanceResponse -> String)
-> ([RegisterOnPremisesInstanceResponse] -> ShowS)
-> Show RegisterOnPremisesInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterOnPremisesInstanceResponse] -> ShowS
$cshowList :: [RegisterOnPremisesInstanceResponse] -> ShowS
show :: RegisterOnPremisesInstanceResponse -> String
$cshow :: RegisterOnPremisesInstanceResponse -> String
showsPrec :: Int -> RegisterOnPremisesInstanceResponse -> ShowS
$cshowsPrec :: Int -> RegisterOnPremisesInstanceResponse -> ShowS
Prelude.Show, (forall x.
RegisterOnPremisesInstanceResponse
-> Rep RegisterOnPremisesInstanceResponse x)
-> (forall x.
Rep RegisterOnPremisesInstanceResponse x
-> RegisterOnPremisesInstanceResponse)
-> Generic RegisterOnPremisesInstanceResponse
forall x.
Rep RegisterOnPremisesInstanceResponse x
-> RegisterOnPremisesInstanceResponse
forall x.
RegisterOnPremisesInstanceResponse
-> Rep RegisterOnPremisesInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterOnPremisesInstanceResponse x
-> RegisterOnPremisesInstanceResponse
$cfrom :: forall x.
RegisterOnPremisesInstanceResponse
-> Rep RegisterOnPremisesInstanceResponse x
Prelude.Generic)
newRegisterOnPremisesInstanceResponse ::
RegisterOnPremisesInstanceResponse
newRegisterOnPremisesInstanceResponse :: RegisterOnPremisesInstanceResponse
newRegisterOnPremisesInstanceResponse =
RegisterOnPremisesInstanceResponse
RegisterOnPremisesInstanceResponse'
instance
Prelude.NFData
RegisterOnPremisesInstanceResponse