{-# 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.Route53RecoveryReadiness.UpdateCell
(
UpdateCell (..),
newUpdateCell,
updateCell_cellName,
updateCell_cells,
UpdateCellResponse (..),
newUpdateCellResponse,
updateCellResponse_cellArn,
updateCellResponse_cellName,
updateCellResponse_cells,
updateCellResponse_parentReadinessScopes,
updateCellResponse_tags,
updateCellResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Route53RecoveryReadiness.Types
data UpdateCell = UpdateCell'
{
UpdateCell -> Text
cellName :: Prelude.Text,
UpdateCell -> [Text]
cells :: [Prelude.Text]
}
deriving (UpdateCell -> UpdateCell -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCell -> UpdateCell -> Bool
$c/= :: UpdateCell -> UpdateCell -> Bool
== :: UpdateCell -> UpdateCell -> Bool
$c== :: UpdateCell -> UpdateCell -> Bool
Prelude.Eq, ReadPrec [UpdateCell]
ReadPrec UpdateCell
Int -> ReadS UpdateCell
ReadS [UpdateCell]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCell]
$creadListPrec :: ReadPrec [UpdateCell]
readPrec :: ReadPrec UpdateCell
$creadPrec :: ReadPrec UpdateCell
readList :: ReadS [UpdateCell]
$creadList :: ReadS [UpdateCell]
readsPrec :: Int -> ReadS UpdateCell
$creadsPrec :: Int -> ReadS UpdateCell
Prelude.Read, Int -> UpdateCell -> ShowS
[UpdateCell] -> ShowS
UpdateCell -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCell] -> ShowS
$cshowList :: [UpdateCell] -> ShowS
show :: UpdateCell -> String
$cshow :: UpdateCell -> String
showsPrec :: Int -> UpdateCell -> ShowS
$cshowsPrec :: Int -> UpdateCell -> ShowS
Prelude.Show, forall x. Rep UpdateCell x -> UpdateCell
forall x. UpdateCell -> Rep UpdateCell x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCell x -> UpdateCell
$cfrom :: forall x. UpdateCell -> Rep UpdateCell x
Prelude.Generic)
newUpdateCell ::
Prelude.Text ->
UpdateCell
newUpdateCell :: Text -> UpdateCell
newUpdateCell Text
pCellName_ =
UpdateCell'
{ $sel:cellName:UpdateCell' :: Text
cellName = Text
pCellName_,
$sel:cells:UpdateCell' :: [Text]
cells = forall a. Monoid a => a
Prelude.mempty
}
updateCell_cellName :: Lens.Lens' UpdateCell Prelude.Text
updateCell_cellName :: Lens' UpdateCell Text
updateCell_cellName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCell' {Text
cellName :: Text
$sel:cellName:UpdateCell' :: UpdateCell -> Text
cellName} -> Text
cellName) (\s :: UpdateCell
s@UpdateCell' {} Text
a -> UpdateCell
s {$sel:cellName:UpdateCell' :: Text
cellName = Text
a} :: UpdateCell)
updateCell_cells :: Lens.Lens' UpdateCell [Prelude.Text]
updateCell_cells :: Lens' UpdateCell [Text]
updateCell_cells = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCell' {[Text]
cells :: [Text]
$sel:cells:UpdateCell' :: UpdateCell -> [Text]
cells} -> [Text]
cells) (\s :: UpdateCell
s@UpdateCell' {} [Text]
a -> UpdateCell
s {$sel:cells:UpdateCell' :: [Text]
cells = [Text]
a} :: UpdateCell) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateCell where
type AWSResponse UpdateCell = UpdateCellResponse
request :: (Service -> Service) -> UpdateCell -> Request UpdateCell
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateCell
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateCell)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe [Text]
-> Maybe (HashMap Text Text)
-> Int
-> UpdateCellResponse
UpdateCellResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"cellArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"cellName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"cells" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"parentReadinessScopes"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateCell where
hashWithSalt :: Int -> UpdateCell -> Int
hashWithSalt Int
_salt UpdateCell' {[Text]
Text
cells :: [Text]
cellName :: Text
$sel:cells:UpdateCell' :: UpdateCell -> [Text]
$sel:cellName:UpdateCell' :: UpdateCell -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
cellName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
cells
instance Prelude.NFData UpdateCell where
rnf :: UpdateCell -> ()
rnf UpdateCell' {[Text]
Text
cells :: [Text]
cellName :: Text
$sel:cells:UpdateCell' :: UpdateCell -> [Text]
$sel:cellName:UpdateCell' :: UpdateCell -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
cellName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
cells
instance Data.ToHeaders UpdateCell where
toHeaders :: UpdateCell -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateCell where
toJSON :: UpdateCell -> Value
toJSON UpdateCell' {[Text]
Text
cells :: [Text]
cellName :: Text
$sel:cells:UpdateCell' :: UpdateCell -> [Text]
$sel:cellName:UpdateCell' :: UpdateCell -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"cells" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
cells)]
)
instance Data.ToPath UpdateCell where
toPath :: UpdateCell -> ByteString
toPath UpdateCell' {[Text]
Text
cells :: [Text]
cellName :: Text
$sel:cells:UpdateCell' :: UpdateCell -> [Text]
$sel:cellName:UpdateCell' :: UpdateCell -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/cells/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
cellName]
instance Data.ToQuery UpdateCell where
toQuery :: UpdateCell -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateCellResponse = UpdateCellResponse'
{
UpdateCellResponse -> Maybe Text
cellArn :: Prelude.Maybe Prelude.Text,
UpdateCellResponse -> Maybe Text
cellName :: Prelude.Maybe Prelude.Text,
UpdateCellResponse -> Maybe [Text]
cells :: Prelude.Maybe [Prelude.Text],
UpdateCellResponse -> Maybe [Text]
parentReadinessScopes :: Prelude.Maybe [Prelude.Text],
UpdateCellResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
UpdateCellResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateCellResponse -> UpdateCellResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCellResponse -> UpdateCellResponse -> Bool
$c/= :: UpdateCellResponse -> UpdateCellResponse -> Bool
== :: UpdateCellResponse -> UpdateCellResponse -> Bool
$c== :: UpdateCellResponse -> UpdateCellResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCellResponse]
ReadPrec UpdateCellResponse
Int -> ReadS UpdateCellResponse
ReadS [UpdateCellResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCellResponse]
$creadListPrec :: ReadPrec [UpdateCellResponse]
readPrec :: ReadPrec UpdateCellResponse
$creadPrec :: ReadPrec UpdateCellResponse
readList :: ReadS [UpdateCellResponse]
$creadList :: ReadS [UpdateCellResponse]
readsPrec :: Int -> ReadS UpdateCellResponse
$creadsPrec :: Int -> ReadS UpdateCellResponse
Prelude.Read, Int -> UpdateCellResponse -> ShowS
[UpdateCellResponse] -> ShowS
UpdateCellResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCellResponse] -> ShowS
$cshowList :: [UpdateCellResponse] -> ShowS
show :: UpdateCellResponse -> String
$cshow :: UpdateCellResponse -> String
showsPrec :: Int -> UpdateCellResponse -> ShowS
$cshowsPrec :: Int -> UpdateCellResponse -> ShowS
Prelude.Show, forall x. Rep UpdateCellResponse x -> UpdateCellResponse
forall x. UpdateCellResponse -> Rep UpdateCellResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCellResponse x -> UpdateCellResponse
$cfrom :: forall x. UpdateCellResponse -> Rep UpdateCellResponse x
Prelude.Generic)
newUpdateCellResponse ::
Prelude.Int ->
UpdateCellResponse
newUpdateCellResponse :: Int -> UpdateCellResponse
newUpdateCellResponse Int
pHttpStatus_ =
UpdateCellResponse'
{ $sel:cellArn:UpdateCellResponse' :: Maybe Text
cellArn = forall a. Maybe a
Prelude.Nothing,
$sel:cellName:UpdateCellResponse' :: Maybe Text
cellName = forall a. Maybe a
Prelude.Nothing,
$sel:cells:UpdateCellResponse' :: Maybe [Text]
cells = forall a. Maybe a
Prelude.Nothing,
$sel:parentReadinessScopes:UpdateCellResponse' :: Maybe [Text]
parentReadinessScopes = forall a. Maybe a
Prelude.Nothing,
$sel:tags:UpdateCellResponse' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateCellResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateCellResponse_cellArn :: Lens.Lens' UpdateCellResponse (Prelude.Maybe Prelude.Text)
updateCellResponse_cellArn :: Lens' UpdateCellResponse (Maybe Text)
updateCellResponse_cellArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCellResponse' {Maybe Text
cellArn :: Maybe Text
$sel:cellArn:UpdateCellResponse' :: UpdateCellResponse -> Maybe Text
cellArn} -> Maybe Text
cellArn) (\s :: UpdateCellResponse
s@UpdateCellResponse' {} Maybe Text
a -> UpdateCellResponse
s {$sel:cellArn:UpdateCellResponse' :: Maybe Text
cellArn = Maybe Text
a} :: UpdateCellResponse)
updateCellResponse_cellName :: Lens.Lens' UpdateCellResponse (Prelude.Maybe Prelude.Text)
updateCellResponse_cellName :: Lens' UpdateCellResponse (Maybe Text)
updateCellResponse_cellName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCellResponse' {Maybe Text
cellName :: Maybe Text
$sel:cellName:UpdateCellResponse' :: UpdateCellResponse -> Maybe Text
cellName} -> Maybe Text
cellName) (\s :: UpdateCellResponse
s@UpdateCellResponse' {} Maybe Text
a -> UpdateCellResponse
s {$sel:cellName:UpdateCellResponse' :: Maybe Text
cellName = Maybe Text
a} :: UpdateCellResponse)
updateCellResponse_cells :: Lens.Lens' UpdateCellResponse (Prelude.Maybe [Prelude.Text])
updateCellResponse_cells :: Lens' UpdateCellResponse (Maybe [Text])
updateCellResponse_cells = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCellResponse' {Maybe [Text]
cells :: Maybe [Text]
$sel:cells:UpdateCellResponse' :: UpdateCellResponse -> Maybe [Text]
cells} -> Maybe [Text]
cells) (\s :: UpdateCellResponse
s@UpdateCellResponse' {} Maybe [Text]
a -> UpdateCellResponse
s {$sel:cells:UpdateCellResponse' :: Maybe [Text]
cells = Maybe [Text]
a} :: UpdateCellResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateCellResponse_parentReadinessScopes :: Lens.Lens' UpdateCellResponse (Prelude.Maybe [Prelude.Text])
updateCellResponse_parentReadinessScopes :: Lens' UpdateCellResponse (Maybe [Text])
updateCellResponse_parentReadinessScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCellResponse' {Maybe [Text]
parentReadinessScopes :: Maybe [Text]
$sel:parentReadinessScopes:UpdateCellResponse' :: UpdateCellResponse -> Maybe [Text]
parentReadinessScopes} -> Maybe [Text]
parentReadinessScopes) (\s :: UpdateCellResponse
s@UpdateCellResponse' {} Maybe [Text]
a -> UpdateCellResponse
s {$sel:parentReadinessScopes:UpdateCellResponse' :: Maybe [Text]
parentReadinessScopes = Maybe [Text]
a} :: UpdateCellResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateCellResponse_tags :: Lens.Lens' UpdateCellResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateCellResponse_tags :: Lens' UpdateCellResponse (Maybe (HashMap Text Text))
updateCellResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCellResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:UpdateCellResponse' :: UpdateCellResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: UpdateCellResponse
s@UpdateCellResponse' {} Maybe (HashMap Text Text)
a -> UpdateCellResponse
s {$sel:tags:UpdateCellResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: UpdateCellResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateCellResponse_httpStatus :: Lens.Lens' UpdateCellResponse Prelude.Int
updateCellResponse_httpStatus :: Lens' UpdateCellResponse Int
updateCellResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCellResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateCellResponse' :: UpdateCellResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateCellResponse
s@UpdateCellResponse' {} Int
a -> UpdateCellResponse
s {$sel:httpStatus:UpdateCellResponse' :: Int
httpStatus = Int
a} :: UpdateCellResponse)
instance Prelude.NFData UpdateCellResponse where
rnf :: UpdateCellResponse -> ()
rnf UpdateCellResponse' {Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
httpStatus :: Int
tags :: Maybe (HashMap Text Text)
parentReadinessScopes :: Maybe [Text]
cells :: Maybe [Text]
cellName :: Maybe Text
cellArn :: Maybe Text
$sel:httpStatus:UpdateCellResponse' :: UpdateCellResponse -> Int
$sel:tags:UpdateCellResponse' :: UpdateCellResponse -> Maybe (HashMap Text Text)
$sel:parentReadinessScopes:UpdateCellResponse' :: UpdateCellResponse -> Maybe [Text]
$sel:cells:UpdateCellResponse' :: UpdateCellResponse -> Maybe [Text]
$sel:cellName:UpdateCellResponse' :: UpdateCellResponse -> Maybe Text
$sel:cellArn:UpdateCellResponse' :: UpdateCellResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cellArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cellName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
cells
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
parentReadinessScopes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus