{-# 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.OpsWorksCM.ExportServerEngineAttribute
(
ExportServerEngineAttribute (..),
newExportServerEngineAttribute,
exportServerEngineAttribute_inputAttributes,
exportServerEngineAttribute_exportAttributeName,
exportServerEngineAttribute_serverName,
ExportServerEngineAttributeResponse (..),
newExportServerEngineAttributeResponse,
exportServerEngineAttributeResponse_serverName,
exportServerEngineAttributeResponse_engineAttribute,
exportServerEngineAttributeResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorksCM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ExportServerEngineAttribute = ExportServerEngineAttribute'
{
ExportServerEngineAttribute -> Maybe [EngineAttribute]
inputAttributes :: Prelude.Maybe [EngineAttribute],
ExportServerEngineAttribute -> Text
exportAttributeName :: Prelude.Text,
ExportServerEngineAttribute -> Text
serverName :: Prelude.Text
}
deriving (ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
(ExportServerEngineAttribute
-> ExportServerEngineAttribute -> Bool)
-> (ExportServerEngineAttribute
-> ExportServerEngineAttribute -> Bool)
-> Eq ExportServerEngineAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
$c/= :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
== :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
$c== :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
Prelude.Eq, Int -> ExportServerEngineAttribute -> ShowS
[ExportServerEngineAttribute] -> ShowS
ExportServerEngineAttribute -> String
(Int -> ExportServerEngineAttribute -> ShowS)
-> (ExportServerEngineAttribute -> String)
-> ([ExportServerEngineAttribute] -> ShowS)
-> Show ExportServerEngineAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportServerEngineAttribute] -> ShowS
$cshowList :: [ExportServerEngineAttribute] -> ShowS
show :: ExportServerEngineAttribute -> String
$cshow :: ExportServerEngineAttribute -> String
showsPrec :: Int -> ExportServerEngineAttribute -> ShowS
$cshowsPrec :: Int -> ExportServerEngineAttribute -> ShowS
Prelude.Show, (forall x.
ExportServerEngineAttribute -> Rep ExportServerEngineAttribute x)
-> (forall x.
Rep ExportServerEngineAttribute x -> ExportServerEngineAttribute)
-> Generic ExportServerEngineAttribute
forall x.
Rep ExportServerEngineAttribute x -> ExportServerEngineAttribute
forall x.
ExportServerEngineAttribute -> Rep ExportServerEngineAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportServerEngineAttribute x -> ExportServerEngineAttribute
$cfrom :: forall x.
ExportServerEngineAttribute -> Rep ExportServerEngineAttribute x
Prelude.Generic)
newExportServerEngineAttribute ::
Prelude.Text ->
Prelude.Text ->
ExportServerEngineAttribute
newExportServerEngineAttribute :: Text -> Text -> ExportServerEngineAttribute
newExportServerEngineAttribute
Text
pExportAttributeName_
Text
pServerName_ =
ExportServerEngineAttribute' :: Maybe [EngineAttribute]
-> Text -> Text -> ExportServerEngineAttribute
ExportServerEngineAttribute'
{ $sel:inputAttributes:ExportServerEngineAttribute' :: Maybe [EngineAttribute]
inputAttributes =
Maybe [EngineAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:exportAttributeName:ExportServerEngineAttribute' :: Text
exportAttributeName = Text
pExportAttributeName_,
$sel:serverName:ExportServerEngineAttribute' :: Text
serverName = Text
pServerName_
}
exportServerEngineAttribute_inputAttributes :: Lens.Lens' ExportServerEngineAttribute (Prelude.Maybe [EngineAttribute])
exportServerEngineAttribute_inputAttributes :: (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute
exportServerEngineAttribute_inputAttributes = (ExportServerEngineAttribute -> Maybe [EngineAttribute])
-> (ExportServerEngineAttribute
-> Maybe [EngineAttribute] -> ExportServerEngineAttribute)
-> Lens
ExportServerEngineAttribute
ExportServerEngineAttribute
(Maybe [EngineAttribute])
(Maybe [EngineAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttribute' {Maybe [EngineAttribute]
inputAttributes :: Maybe [EngineAttribute]
$sel:inputAttributes:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Maybe [EngineAttribute]
inputAttributes} -> Maybe [EngineAttribute]
inputAttributes) (\s :: ExportServerEngineAttribute
s@ExportServerEngineAttribute' {} Maybe [EngineAttribute]
a -> ExportServerEngineAttribute
s {$sel:inputAttributes:ExportServerEngineAttribute' :: Maybe [EngineAttribute]
inputAttributes = Maybe [EngineAttribute]
a} :: ExportServerEngineAttribute) ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute)
-> ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> ExportServerEngineAttribute
-> f ExportServerEngineAttribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[EngineAttribute]
[EngineAttribute]
[EngineAttribute]
[EngineAttribute]
-> Iso
(Maybe [EngineAttribute])
(Maybe [EngineAttribute])
(Maybe [EngineAttribute])
(Maybe [EngineAttribute])
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
[EngineAttribute]
[EngineAttribute]
[EngineAttribute]
[EngineAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
exportServerEngineAttribute_exportAttributeName :: Lens.Lens' ExportServerEngineAttribute Prelude.Text
exportServerEngineAttribute_exportAttributeName :: (Text -> f Text)
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute
exportServerEngineAttribute_exportAttributeName = (ExportServerEngineAttribute -> Text)
-> (ExportServerEngineAttribute
-> Text -> ExportServerEngineAttribute)
-> Lens
ExportServerEngineAttribute ExportServerEngineAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttribute' {Text
exportAttributeName :: Text
$sel:exportAttributeName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
exportAttributeName} -> Text
exportAttributeName) (\s :: ExportServerEngineAttribute
s@ExportServerEngineAttribute' {} Text
a -> ExportServerEngineAttribute
s {$sel:exportAttributeName:ExportServerEngineAttribute' :: Text
exportAttributeName = Text
a} :: ExportServerEngineAttribute)
exportServerEngineAttribute_serverName :: Lens.Lens' ExportServerEngineAttribute Prelude.Text
exportServerEngineAttribute_serverName :: (Text -> f Text)
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute
exportServerEngineAttribute_serverName = (ExportServerEngineAttribute -> Text)
-> (ExportServerEngineAttribute
-> Text -> ExportServerEngineAttribute)
-> Lens
ExportServerEngineAttribute ExportServerEngineAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttribute' {Text
serverName :: Text
$sel:serverName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
serverName} -> Text
serverName) (\s :: ExportServerEngineAttribute
s@ExportServerEngineAttribute' {} Text
a -> ExportServerEngineAttribute
s {$sel:serverName:ExportServerEngineAttribute' :: Text
serverName = Text
a} :: ExportServerEngineAttribute)
instance Core.AWSRequest ExportServerEngineAttribute where
type
AWSResponse ExportServerEngineAttribute =
ExportServerEngineAttributeResponse
request :: ExportServerEngineAttribute -> Request ExportServerEngineAttribute
request = Service
-> ExportServerEngineAttribute
-> Request ExportServerEngineAttribute
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ExportServerEngineAttribute
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ExportServerEngineAttribute)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ExportServerEngineAttribute))
-> Logger
-> Service
-> Proxy ExportServerEngineAttribute
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ExportServerEngineAttribute)))
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 ->
Maybe Text
-> Maybe EngineAttribute
-> Int
-> ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse'
(Maybe Text
-> Maybe EngineAttribute
-> Int
-> ExportServerEngineAttributeResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe EngineAttribute
-> Int -> ExportServerEngineAttributeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ServerName")
Either
String
(Maybe EngineAttribute
-> Int -> ExportServerEngineAttributeResponse)
-> Either String (Maybe EngineAttribute)
-> Either String (Int -> ExportServerEngineAttributeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EngineAttribute)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EngineAttribute")
Either String (Int -> ExportServerEngineAttributeResponse)
-> Either String Int
-> Either String ExportServerEngineAttributeResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable ExportServerEngineAttribute
instance Prelude.NFData ExportServerEngineAttribute
instance Core.ToHeaders ExportServerEngineAttribute where
toHeaders :: ExportServerEngineAttribute -> ResponseHeaders
toHeaders =
ResponseHeaders -> ExportServerEngineAttribute -> 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
"OpsWorksCM_V2016_11_01.ExportServerEngineAttribute" ::
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 ExportServerEngineAttribute where
toJSON :: ExportServerEngineAttribute -> Value
toJSON ExportServerEngineAttribute' {Maybe [EngineAttribute]
Text
serverName :: Text
exportAttributeName :: Text
inputAttributes :: Maybe [EngineAttribute]
$sel:serverName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
$sel:exportAttributeName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
$sel:inputAttributes:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Maybe [EngineAttribute]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InputAttributes" Text -> [EngineAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([EngineAttribute] -> Pair)
-> Maybe [EngineAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EngineAttribute]
inputAttributes,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ExportAttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
exportAttributeName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverName)
]
)
instance Core.ToPath ExportServerEngineAttribute where
toPath :: ExportServerEngineAttribute -> ByteString
toPath = ByteString -> ExportServerEngineAttribute -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ExportServerEngineAttribute where
toQuery :: ExportServerEngineAttribute -> QueryString
toQuery = QueryString -> ExportServerEngineAttribute -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ExportServerEngineAttributeResponse = ExportServerEngineAttributeResponse'
{
ExportServerEngineAttributeResponse -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
ExportServerEngineAttributeResponse -> Maybe EngineAttribute
engineAttribute :: Prelude.Maybe EngineAttribute,
ExportServerEngineAttributeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
(ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool)
-> (ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool)
-> Eq ExportServerEngineAttributeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
$c/= :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
== :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
$c== :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
Prelude.Eq, Int -> ExportServerEngineAttributeResponse -> ShowS
[ExportServerEngineAttributeResponse] -> ShowS
ExportServerEngineAttributeResponse -> String
(Int -> ExportServerEngineAttributeResponse -> ShowS)
-> (ExportServerEngineAttributeResponse -> String)
-> ([ExportServerEngineAttributeResponse] -> ShowS)
-> Show ExportServerEngineAttributeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportServerEngineAttributeResponse] -> ShowS
$cshowList :: [ExportServerEngineAttributeResponse] -> ShowS
show :: ExportServerEngineAttributeResponse -> String
$cshow :: ExportServerEngineAttributeResponse -> String
showsPrec :: Int -> ExportServerEngineAttributeResponse -> ShowS
$cshowsPrec :: Int -> ExportServerEngineAttributeResponse -> ShowS
Prelude.Show, (forall x.
ExportServerEngineAttributeResponse
-> Rep ExportServerEngineAttributeResponse x)
-> (forall x.
Rep ExportServerEngineAttributeResponse x
-> ExportServerEngineAttributeResponse)
-> Generic ExportServerEngineAttributeResponse
forall x.
Rep ExportServerEngineAttributeResponse x
-> ExportServerEngineAttributeResponse
forall x.
ExportServerEngineAttributeResponse
-> Rep ExportServerEngineAttributeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportServerEngineAttributeResponse x
-> ExportServerEngineAttributeResponse
$cfrom :: forall x.
ExportServerEngineAttributeResponse
-> Rep ExportServerEngineAttributeResponse x
Prelude.Generic)
newExportServerEngineAttributeResponse ::
Prelude.Int ->
ExportServerEngineAttributeResponse
newExportServerEngineAttributeResponse :: Int -> ExportServerEngineAttributeResponse
newExportServerEngineAttributeResponse Int
pHttpStatus_ =
ExportServerEngineAttributeResponse' :: Maybe Text
-> Maybe EngineAttribute
-> Int
-> ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse'
{ $sel:serverName:ExportServerEngineAttributeResponse' :: Maybe Text
serverName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:engineAttribute:ExportServerEngineAttributeResponse' :: Maybe EngineAttribute
engineAttribute = Maybe EngineAttribute
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ExportServerEngineAttributeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
exportServerEngineAttributeResponse_serverName :: Lens.Lens' ExportServerEngineAttributeResponse (Prelude.Maybe Prelude.Text)
exportServerEngineAttributeResponse_serverName :: (Maybe Text -> f (Maybe Text))
-> ExportServerEngineAttributeResponse
-> f ExportServerEngineAttributeResponse
exportServerEngineAttributeResponse_serverName = (ExportServerEngineAttributeResponse -> Maybe Text)
-> (ExportServerEngineAttributeResponse
-> Maybe Text -> ExportServerEngineAttributeResponse)
-> Lens
ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttributeResponse' {Maybe Text
serverName :: Maybe Text
$sel:serverName:ExportServerEngineAttributeResponse' :: ExportServerEngineAttributeResponse -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: ExportServerEngineAttributeResponse
s@ExportServerEngineAttributeResponse' {} Maybe Text
a -> ExportServerEngineAttributeResponse
s {$sel:serverName:ExportServerEngineAttributeResponse' :: Maybe Text
serverName = Maybe Text
a} :: ExportServerEngineAttributeResponse)
exportServerEngineAttributeResponse_engineAttribute :: Lens.Lens' ExportServerEngineAttributeResponse (Prelude.Maybe EngineAttribute)
exportServerEngineAttributeResponse_engineAttribute :: (Maybe EngineAttribute -> f (Maybe EngineAttribute))
-> ExportServerEngineAttributeResponse
-> f ExportServerEngineAttributeResponse
exportServerEngineAttributeResponse_engineAttribute = (ExportServerEngineAttributeResponse -> Maybe EngineAttribute)
-> (ExportServerEngineAttributeResponse
-> Maybe EngineAttribute -> ExportServerEngineAttributeResponse)
-> Lens
ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse
(Maybe EngineAttribute)
(Maybe EngineAttribute)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttributeResponse' {Maybe EngineAttribute
engineAttribute :: Maybe EngineAttribute
$sel:engineAttribute:ExportServerEngineAttributeResponse' :: ExportServerEngineAttributeResponse -> Maybe EngineAttribute
engineAttribute} -> Maybe EngineAttribute
engineAttribute) (\s :: ExportServerEngineAttributeResponse
s@ExportServerEngineAttributeResponse' {} Maybe EngineAttribute
a -> ExportServerEngineAttributeResponse
s {$sel:engineAttribute:ExportServerEngineAttributeResponse' :: Maybe EngineAttribute
engineAttribute = Maybe EngineAttribute
a} :: ExportServerEngineAttributeResponse)
exportServerEngineAttributeResponse_httpStatus :: Lens.Lens' ExportServerEngineAttributeResponse Prelude.Int
exportServerEngineAttributeResponse_httpStatus :: (Int -> f Int)
-> ExportServerEngineAttributeResponse
-> f ExportServerEngineAttributeResponse
exportServerEngineAttributeResponse_httpStatus = (ExportServerEngineAttributeResponse -> Int)
-> (ExportServerEngineAttributeResponse
-> Int -> ExportServerEngineAttributeResponse)
-> Lens
ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttributeResponse' {Int
httpStatus :: Int
$sel:httpStatus:ExportServerEngineAttributeResponse' :: ExportServerEngineAttributeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ExportServerEngineAttributeResponse
s@ExportServerEngineAttributeResponse' {} Int
a -> ExportServerEngineAttributeResponse
s {$sel:httpStatus:ExportServerEngineAttributeResponse' :: Int
httpStatus = Int
a} :: ExportServerEngineAttributeResponse)
instance
Prelude.NFData
ExportServerEngineAttributeResponse