{-# 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.SSM.UpdateAssociationStatus
(
UpdateAssociationStatus (..),
newUpdateAssociationStatus,
updateAssociationStatus_name,
updateAssociationStatus_instanceId,
updateAssociationStatus_associationStatus,
UpdateAssociationStatusResponse (..),
newUpdateAssociationStatusResponse,
updateAssociationStatusResponse_associationDescription,
updateAssociationStatusResponse_httpStatus,
)
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.SSM.Types
data UpdateAssociationStatus = UpdateAssociationStatus'
{
UpdateAssociationStatus -> Text
name :: Prelude.Text,
UpdateAssociationStatus -> Text
instanceId :: Prelude.Text,
UpdateAssociationStatus -> AssociationStatus
associationStatus :: AssociationStatus
}
deriving (UpdateAssociationStatus -> UpdateAssociationStatus -> Bool
(UpdateAssociationStatus -> UpdateAssociationStatus -> Bool)
-> (UpdateAssociationStatus -> UpdateAssociationStatus -> Bool)
-> Eq UpdateAssociationStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssociationStatus -> UpdateAssociationStatus -> Bool
$c/= :: UpdateAssociationStatus -> UpdateAssociationStatus -> Bool
== :: UpdateAssociationStatus -> UpdateAssociationStatus -> Bool
$c== :: UpdateAssociationStatus -> UpdateAssociationStatus -> Bool
Prelude.Eq, ReadPrec [UpdateAssociationStatus]
ReadPrec UpdateAssociationStatus
Int -> ReadS UpdateAssociationStatus
ReadS [UpdateAssociationStatus]
(Int -> ReadS UpdateAssociationStatus)
-> ReadS [UpdateAssociationStatus]
-> ReadPrec UpdateAssociationStatus
-> ReadPrec [UpdateAssociationStatus]
-> Read UpdateAssociationStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAssociationStatus]
$creadListPrec :: ReadPrec [UpdateAssociationStatus]
readPrec :: ReadPrec UpdateAssociationStatus
$creadPrec :: ReadPrec UpdateAssociationStatus
readList :: ReadS [UpdateAssociationStatus]
$creadList :: ReadS [UpdateAssociationStatus]
readsPrec :: Int -> ReadS UpdateAssociationStatus
$creadsPrec :: Int -> ReadS UpdateAssociationStatus
Prelude.Read, Int -> UpdateAssociationStatus -> ShowS
[UpdateAssociationStatus] -> ShowS
UpdateAssociationStatus -> String
(Int -> UpdateAssociationStatus -> ShowS)
-> (UpdateAssociationStatus -> String)
-> ([UpdateAssociationStatus] -> ShowS)
-> Show UpdateAssociationStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssociationStatus] -> ShowS
$cshowList :: [UpdateAssociationStatus] -> ShowS
show :: UpdateAssociationStatus -> String
$cshow :: UpdateAssociationStatus -> String
showsPrec :: Int -> UpdateAssociationStatus -> ShowS
$cshowsPrec :: Int -> UpdateAssociationStatus -> ShowS
Prelude.Show, (forall x.
UpdateAssociationStatus -> Rep UpdateAssociationStatus x)
-> (forall x.
Rep UpdateAssociationStatus x -> UpdateAssociationStatus)
-> Generic UpdateAssociationStatus
forall x. Rep UpdateAssociationStatus x -> UpdateAssociationStatus
forall x. UpdateAssociationStatus -> Rep UpdateAssociationStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAssociationStatus x -> UpdateAssociationStatus
$cfrom :: forall x. UpdateAssociationStatus -> Rep UpdateAssociationStatus x
Prelude.Generic)
newUpdateAssociationStatus ::
Prelude.Text ->
Prelude.Text ->
AssociationStatus ->
UpdateAssociationStatus
newUpdateAssociationStatus :: Text -> Text -> AssociationStatus -> UpdateAssociationStatus
newUpdateAssociationStatus
Text
pName_
Text
pInstanceId_
AssociationStatus
pAssociationStatus_ =
UpdateAssociationStatus' :: Text -> Text -> AssociationStatus -> UpdateAssociationStatus
UpdateAssociationStatus'
{ $sel:name:UpdateAssociationStatus' :: Text
name = Text
pName_,
$sel:instanceId:UpdateAssociationStatus' :: Text
instanceId = Text
pInstanceId_,
$sel:associationStatus:UpdateAssociationStatus' :: AssociationStatus
associationStatus = AssociationStatus
pAssociationStatus_
}
updateAssociationStatus_name :: Lens.Lens' UpdateAssociationStatus Prelude.Text
updateAssociationStatus_name :: (Text -> f Text)
-> UpdateAssociationStatus -> f UpdateAssociationStatus
updateAssociationStatus_name = (UpdateAssociationStatus -> Text)
-> (UpdateAssociationStatus -> Text -> UpdateAssociationStatus)
-> Lens UpdateAssociationStatus UpdateAssociationStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationStatus' {Text
name :: Text
$sel:name:UpdateAssociationStatus' :: UpdateAssociationStatus -> Text
name} -> Text
name) (\s :: UpdateAssociationStatus
s@UpdateAssociationStatus' {} Text
a -> UpdateAssociationStatus
s {$sel:name:UpdateAssociationStatus' :: Text
name = Text
a} :: UpdateAssociationStatus)
updateAssociationStatus_instanceId :: Lens.Lens' UpdateAssociationStatus Prelude.Text
updateAssociationStatus_instanceId :: (Text -> f Text)
-> UpdateAssociationStatus -> f UpdateAssociationStatus
updateAssociationStatus_instanceId = (UpdateAssociationStatus -> Text)
-> (UpdateAssociationStatus -> Text -> UpdateAssociationStatus)
-> Lens UpdateAssociationStatus UpdateAssociationStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationStatus' {Text
instanceId :: Text
$sel:instanceId:UpdateAssociationStatus' :: UpdateAssociationStatus -> Text
instanceId} -> Text
instanceId) (\s :: UpdateAssociationStatus
s@UpdateAssociationStatus' {} Text
a -> UpdateAssociationStatus
s {$sel:instanceId:UpdateAssociationStatus' :: Text
instanceId = Text
a} :: UpdateAssociationStatus)
updateAssociationStatus_associationStatus :: Lens.Lens' UpdateAssociationStatus AssociationStatus
updateAssociationStatus_associationStatus :: (AssociationStatus -> f AssociationStatus)
-> UpdateAssociationStatus -> f UpdateAssociationStatus
updateAssociationStatus_associationStatus = (UpdateAssociationStatus -> AssociationStatus)
-> (UpdateAssociationStatus
-> AssociationStatus -> UpdateAssociationStatus)
-> Lens
UpdateAssociationStatus
UpdateAssociationStatus
AssociationStatus
AssociationStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationStatus' {AssociationStatus
associationStatus :: AssociationStatus
$sel:associationStatus:UpdateAssociationStatus' :: UpdateAssociationStatus -> AssociationStatus
associationStatus} -> AssociationStatus
associationStatus) (\s :: UpdateAssociationStatus
s@UpdateAssociationStatus' {} AssociationStatus
a -> UpdateAssociationStatus
s {$sel:associationStatus:UpdateAssociationStatus' :: AssociationStatus
associationStatus = AssociationStatus
a} :: UpdateAssociationStatus)
instance Core.AWSRequest UpdateAssociationStatus where
type
AWSResponse UpdateAssociationStatus =
UpdateAssociationStatusResponse
request :: UpdateAssociationStatus -> Request UpdateAssociationStatus
request = Service
-> UpdateAssociationStatus -> Request UpdateAssociationStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateAssociationStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAssociationStatus)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateAssociationStatus))
-> Logger
-> Service
-> Proxy UpdateAssociationStatus
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAssociationStatus)))
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 AssociationDescription
-> Int -> UpdateAssociationStatusResponse
UpdateAssociationStatusResponse'
(Maybe AssociationDescription
-> Int -> UpdateAssociationStatusResponse)
-> Either String (Maybe AssociationDescription)
-> Either String (Int -> UpdateAssociationStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AssociationDescription)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssociationDescription")
Either String (Int -> UpdateAssociationStatusResponse)
-> Either String Int
-> Either String UpdateAssociationStatusResponse
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 UpdateAssociationStatus
instance Prelude.NFData UpdateAssociationStatus
instance Core.ToHeaders UpdateAssociationStatus where
toHeaders :: UpdateAssociationStatus -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateAssociationStatus -> 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
"AmazonSSM.UpdateAssociationStatus" ::
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 UpdateAssociationStatus where
toJSON :: UpdateAssociationStatus -> Value
toJSON UpdateAssociationStatus' {Text
AssociationStatus
associationStatus :: AssociationStatus
instanceId :: Text
name :: Text
$sel:associationStatus:UpdateAssociationStatus' :: UpdateAssociationStatus -> AssociationStatus
$sel:instanceId:UpdateAssociationStatus' :: UpdateAssociationStatus -> Text
$sel:name:UpdateAssociationStatus' :: UpdateAssociationStatus -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"AssociationStatus" Text -> AssociationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssociationStatus
associationStatus)
]
)
instance Core.ToPath UpdateAssociationStatus where
toPath :: UpdateAssociationStatus -> ByteString
toPath = ByteString -> UpdateAssociationStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateAssociationStatus where
toQuery :: UpdateAssociationStatus -> QueryString
toQuery = QueryString -> UpdateAssociationStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateAssociationStatusResponse = UpdateAssociationStatusResponse'
{
UpdateAssociationStatusResponse -> Maybe AssociationDescription
associationDescription :: Prelude.Maybe AssociationDescription,
UpdateAssociationStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool
(UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool)
-> (UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool)
-> Eq UpdateAssociationStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool
$c/= :: UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool
== :: UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool
$c== :: UpdateAssociationStatusResponse
-> UpdateAssociationStatusResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAssociationStatusResponse]
ReadPrec UpdateAssociationStatusResponse
Int -> ReadS UpdateAssociationStatusResponse
ReadS [UpdateAssociationStatusResponse]
(Int -> ReadS UpdateAssociationStatusResponse)
-> ReadS [UpdateAssociationStatusResponse]
-> ReadPrec UpdateAssociationStatusResponse
-> ReadPrec [UpdateAssociationStatusResponse]
-> Read UpdateAssociationStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAssociationStatusResponse]
$creadListPrec :: ReadPrec [UpdateAssociationStatusResponse]
readPrec :: ReadPrec UpdateAssociationStatusResponse
$creadPrec :: ReadPrec UpdateAssociationStatusResponse
readList :: ReadS [UpdateAssociationStatusResponse]
$creadList :: ReadS [UpdateAssociationStatusResponse]
readsPrec :: Int -> ReadS UpdateAssociationStatusResponse
$creadsPrec :: Int -> ReadS UpdateAssociationStatusResponse
Prelude.Read, Int -> UpdateAssociationStatusResponse -> ShowS
[UpdateAssociationStatusResponse] -> ShowS
UpdateAssociationStatusResponse -> String
(Int -> UpdateAssociationStatusResponse -> ShowS)
-> (UpdateAssociationStatusResponse -> String)
-> ([UpdateAssociationStatusResponse] -> ShowS)
-> Show UpdateAssociationStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssociationStatusResponse] -> ShowS
$cshowList :: [UpdateAssociationStatusResponse] -> ShowS
show :: UpdateAssociationStatusResponse -> String
$cshow :: UpdateAssociationStatusResponse -> String
showsPrec :: Int -> UpdateAssociationStatusResponse -> ShowS
$cshowsPrec :: Int -> UpdateAssociationStatusResponse -> ShowS
Prelude.Show, (forall x.
UpdateAssociationStatusResponse
-> Rep UpdateAssociationStatusResponse x)
-> (forall x.
Rep UpdateAssociationStatusResponse x
-> UpdateAssociationStatusResponse)
-> Generic UpdateAssociationStatusResponse
forall x.
Rep UpdateAssociationStatusResponse x
-> UpdateAssociationStatusResponse
forall x.
UpdateAssociationStatusResponse
-> Rep UpdateAssociationStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAssociationStatusResponse x
-> UpdateAssociationStatusResponse
$cfrom :: forall x.
UpdateAssociationStatusResponse
-> Rep UpdateAssociationStatusResponse x
Prelude.Generic)
newUpdateAssociationStatusResponse ::
Prelude.Int ->
UpdateAssociationStatusResponse
newUpdateAssociationStatusResponse :: Int -> UpdateAssociationStatusResponse
newUpdateAssociationStatusResponse Int
pHttpStatus_ =
UpdateAssociationStatusResponse' :: Maybe AssociationDescription
-> Int -> UpdateAssociationStatusResponse
UpdateAssociationStatusResponse'
{ $sel:associationDescription:UpdateAssociationStatusResponse' :: Maybe AssociationDescription
associationDescription =
Maybe AssociationDescription
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAssociationStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAssociationStatusResponse_associationDescription :: Lens.Lens' UpdateAssociationStatusResponse (Prelude.Maybe AssociationDescription)
updateAssociationStatusResponse_associationDescription :: (Maybe AssociationDescription -> f (Maybe AssociationDescription))
-> UpdateAssociationStatusResponse
-> f UpdateAssociationStatusResponse
updateAssociationStatusResponse_associationDescription = (UpdateAssociationStatusResponse -> Maybe AssociationDescription)
-> (UpdateAssociationStatusResponse
-> Maybe AssociationDescription -> UpdateAssociationStatusResponse)
-> Lens
UpdateAssociationStatusResponse
UpdateAssociationStatusResponse
(Maybe AssociationDescription)
(Maybe AssociationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationStatusResponse' {Maybe AssociationDescription
associationDescription :: Maybe AssociationDescription
$sel:associationDescription:UpdateAssociationStatusResponse' :: UpdateAssociationStatusResponse -> Maybe AssociationDescription
associationDescription} -> Maybe AssociationDescription
associationDescription) (\s :: UpdateAssociationStatusResponse
s@UpdateAssociationStatusResponse' {} Maybe AssociationDescription
a -> UpdateAssociationStatusResponse
s {$sel:associationDescription:UpdateAssociationStatusResponse' :: Maybe AssociationDescription
associationDescription = Maybe AssociationDescription
a} :: UpdateAssociationStatusResponse)
updateAssociationStatusResponse_httpStatus :: Lens.Lens' UpdateAssociationStatusResponse Prelude.Int
updateAssociationStatusResponse_httpStatus :: (Int -> f Int)
-> UpdateAssociationStatusResponse
-> f UpdateAssociationStatusResponse
updateAssociationStatusResponse_httpStatus = (UpdateAssociationStatusResponse -> Int)
-> (UpdateAssociationStatusResponse
-> Int -> UpdateAssociationStatusResponse)
-> Lens
UpdateAssociationStatusResponse
UpdateAssociationStatusResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAssociationStatusResponse' :: UpdateAssociationStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAssociationStatusResponse
s@UpdateAssociationStatusResponse' {} Int
a -> UpdateAssociationStatusResponse
s {$sel:httpStatus:UpdateAssociationStatusResponse' :: Int
httpStatus = Int
a} :: UpdateAssociationStatusResponse)
instance
Prelude.NFData
UpdateAssociationStatusResponse