{-# 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.ServiceCatalog.UpdateTagOption
(
UpdateTagOption (..),
newUpdateTagOption,
updateTagOption_value,
updateTagOption_active,
updateTagOption_id,
UpdateTagOptionResponse (..),
newUpdateTagOptionResponse,
updateTagOptionResponse_tagOptionDetail,
updateTagOptionResponse_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.ServiceCatalog.Types
data UpdateTagOption = UpdateTagOption'
{
UpdateTagOption -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
UpdateTagOption -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
UpdateTagOption -> Text
id :: Prelude.Text
}
deriving (UpdateTagOption -> UpdateTagOption -> Bool
(UpdateTagOption -> UpdateTagOption -> Bool)
-> (UpdateTagOption -> UpdateTagOption -> Bool)
-> Eq UpdateTagOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTagOption -> UpdateTagOption -> Bool
$c/= :: UpdateTagOption -> UpdateTagOption -> Bool
== :: UpdateTagOption -> UpdateTagOption -> Bool
$c== :: UpdateTagOption -> UpdateTagOption -> Bool
Prelude.Eq, ReadPrec [UpdateTagOption]
ReadPrec UpdateTagOption
Int -> ReadS UpdateTagOption
ReadS [UpdateTagOption]
(Int -> ReadS UpdateTagOption)
-> ReadS [UpdateTagOption]
-> ReadPrec UpdateTagOption
-> ReadPrec [UpdateTagOption]
-> Read UpdateTagOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTagOption]
$creadListPrec :: ReadPrec [UpdateTagOption]
readPrec :: ReadPrec UpdateTagOption
$creadPrec :: ReadPrec UpdateTagOption
readList :: ReadS [UpdateTagOption]
$creadList :: ReadS [UpdateTagOption]
readsPrec :: Int -> ReadS UpdateTagOption
$creadsPrec :: Int -> ReadS UpdateTagOption
Prelude.Read, Int -> UpdateTagOption -> ShowS
[UpdateTagOption] -> ShowS
UpdateTagOption -> String
(Int -> UpdateTagOption -> ShowS)
-> (UpdateTagOption -> String)
-> ([UpdateTagOption] -> ShowS)
-> Show UpdateTagOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTagOption] -> ShowS
$cshowList :: [UpdateTagOption] -> ShowS
show :: UpdateTagOption -> String
$cshow :: UpdateTagOption -> String
showsPrec :: Int -> UpdateTagOption -> ShowS
$cshowsPrec :: Int -> UpdateTagOption -> ShowS
Prelude.Show, (forall x. UpdateTagOption -> Rep UpdateTagOption x)
-> (forall x. Rep UpdateTagOption x -> UpdateTagOption)
-> Generic UpdateTagOption
forall x. Rep UpdateTagOption x -> UpdateTagOption
forall x. UpdateTagOption -> Rep UpdateTagOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTagOption x -> UpdateTagOption
$cfrom :: forall x. UpdateTagOption -> Rep UpdateTagOption x
Prelude.Generic)
newUpdateTagOption ::
Prelude.Text ->
UpdateTagOption
newUpdateTagOption :: Text -> UpdateTagOption
newUpdateTagOption Text
pId_ =
UpdateTagOption' :: Maybe Text -> Maybe Bool -> Text -> UpdateTagOption
UpdateTagOption'
{ $sel:value:UpdateTagOption' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:active:UpdateTagOption' :: Maybe Bool
active = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:id:UpdateTagOption' :: Text
id = Text
pId_
}
updateTagOption_value :: Lens.Lens' UpdateTagOption (Prelude.Maybe Prelude.Text)
updateTagOption_value :: (Maybe Text -> f (Maybe Text))
-> UpdateTagOption -> f UpdateTagOption
updateTagOption_value = (UpdateTagOption -> Maybe Text)
-> (UpdateTagOption -> Maybe Text -> UpdateTagOption)
-> Lens UpdateTagOption UpdateTagOption (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagOption' {Maybe Text
value :: Maybe Text
$sel:value:UpdateTagOption' :: UpdateTagOption -> Maybe Text
value} -> Maybe Text
value) (\s :: UpdateTagOption
s@UpdateTagOption' {} Maybe Text
a -> UpdateTagOption
s {$sel:value:UpdateTagOption' :: Maybe Text
value = Maybe Text
a} :: UpdateTagOption)
updateTagOption_active :: Lens.Lens' UpdateTagOption (Prelude.Maybe Prelude.Bool)
updateTagOption_active :: (Maybe Bool -> f (Maybe Bool))
-> UpdateTagOption -> f UpdateTagOption
updateTagOption_active = (UpdateTagOption -> Maybe Bool)
-> (UpdateTagOption -> Maybe Bool -> UpdateTagOption)
-> Lens UpdateTagOption UpdateTagOption (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagOption' {Maybe Bool
active :: Maybe Bool
$sel:active:UpdateTagOption' :: UpdateTagOption -> Maybe Bool
active} -> Maybe Bool
active) (\s :: UpdateTagOption
s@UpdateTagOption' {} Maybe Bool
a -> UpdateTagOption
s {$sel:active:UpdateTagOption' :: Maybe Bool
active = Maybe Bool
a} :: UpdateTagOption)
updateTagOption_id :: Lens.Lens' UpdateTagOption Prelude.Text
updateTagOption_id :: (Text -> f Text) -> UpdateTagOption -> f UpdateTagOption
updateTagOption_id = (UpdateTagOption -> Text)
-> (UpdateTagOption -> Text -> UpdateTagOption)
-> Lens UpdateTagOption UpdateTagOption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagOption' {Text
id :: Text
$sel:id:UpdateTagOption' :: UpdateTagOption -> Text
id} -> Text
id) (\s :: UpdateTagOption
s@UpdateTagOption' {} Text
a -> UpdateTagOption
s {$sel:id:UpdateTagOption' :: Text
id = Text
a} :: UpdateTagOption)
instance Core.AWSRequest UpdateTagOption where
type
AWSResponse UpdateTagOption =
UpdateTagOptionResponse
request :: UpdateTagOption -> Request UpdateTagOption
request = Service -> UpdateTagOption -> Request UpdateTagOption
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateTagOption
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTagOption)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateTagOption))
-> Logger
-> Service
-> Proxy UpdateTagOption
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTagOption)))
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 TagOptionDetail -> Int -> UpdateTagOptionResponse
UpdateTagOptionResponse'
(Maybe TagOptionDetail -> Int -> UpdateTagOptionResponse)
-> Either String (Maybe TagOptionDetail)
-> Either String (Int -> UpdateTagOptionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe TagOptionDetail)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TagOptionDetail")
Either String (Int -> UpdateTagOptionResponse)
-> Either String Int -> Either String UpdateTagOptionResponse
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 UpdateTagOption
instance Prelude.NFData UpdateTagOption
instance Core.ToHeaders UpdateTagOption where
toHeaders :: UpdateTagOption -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateTagOption -> 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
"AWS242ServiceCatalogService.UpdateTagOption" ::
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 UpdateTagOption where
toJSON :: UpdateTagOption -> Value
toJSON UpdateTagOption' {Maybe Bool
Maybe Text
Text
id :: Text
active :: Maybe Bool
value :: Maybe Text
$sel:id:UpdateTagOption' :: UpdateTagOption -> Text
$sel:active:UpdateTagOption' :: UpdateTagOption -> Maybe Bool
$sel:value:UpdateTagOption' :: UpdateTagOption -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Value" 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
value,
(Text
"Active" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
active,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
]
)
instance Core.ToPath UpdateTagOption where
toPath :: UpdateTagOption -> ByteString
toPath = ByteString -> UpdateTagOption -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateTagOption where
toQuery :: UpdateTagOption -> QueryString
toQuery = QueryString -> UpdateTagOption -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateTagOptionResponse = UpdateTagOptionResponse'
{
UpdateTagOptionResponse -> Maybe TagOptionDetail
tagOptionDetail :: Prelude.Maybe TagOptionDetail,
UpdateTagOptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool
(UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool)
-> (UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool)
-> Eq UpdateTagOptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool
$c/= :: UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool
== :: UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool
$c== :: UpdateTagOptionResponse -> UpdateTagOptionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTagOptionResponse]
ReadPrec UpdateTagOptionResponse
Int -> ReadS UpdateTagOptionResponse
ReadS [UpdateTagOptionResponse]
(Int -> ReadS UpdateTagOptionResponse)
-> ReadS [UpdateTagOptionResponse]
-> ReadPrec UpdateTagOptionResponse
-> ReadPrec [UpdateTagOptionResponse]
-> Read UpdateTagOptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTagOptionResponse]
$creadListPrec :: ReadPrec [UpdateTagOptionResponse]
readPrec :: ReadPrec UpdateTagOptionResponse
$creadPrec :: ReadPrec UpdateTagOptionResponse
readList :: ReadS [UpdateTagOptionResponse]
$creadList :: ReadS [UpdateTagOptionResponse]
readsPrec :: Int -> ReadS UpdateTagOptionResponse
$creadsPrec :: Int -> ReadS UpdateTagOptionResponse
Prelude.Read, Int -> UpdateTagOptionResponse -> ShowS
[UpdateTagOptionResponse] -> ShowS
UpdateTagOptionResponse -> String
(Int -> UpdateTagOptionResponse -> ShowS)
-> (UpdateTagOptionResponse -> String)
-> ([UpdateTagOptionResponse] -> ShowS)
-> Show UpdateTagOptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTagOptionResponse] -> ShowS
$cshowList :: [UpdateTagOptionResponse] -> ShowS
show :: UpdateTagOptionResponse -> String
$cshow :: UpdateTagOptionResponse -> String
showsPrec :: Int -> UpdateTagOptionResponse -> ShowS
$cshowsPrec :: Int -> UpdateTagOptionResponse -> ShowS
Prelude.Show, (forall x.
UpdateTagOptionResponse -> Rep UpdateTagOptionResponse x)
-> (forall x.
Rep UpdateTagOptionResponse x -> UpdateTagOptionResponse)
-> Generic UpdateTagOptionResponse
forall x. Rep UpdateTagOptionResponse x -> UpdateTagOptionResponse
forall x. UpdateTagOptionResponse -> Rep UpdateTagOptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTagOptionResponse x -> UpdateTagOptionResponse
$cfrom :: forall x. UpdateTagOptionResponse -> Rep UpdateTagOptionResponse x
Prelude.Generic)
newUpdateTagOptionResponse ::
Prelude.Int ->
UpdateTagOptionResponse
newUpdateTagOptionResponse :: Int -> UpdateTagOptionResponse
newUpdateTagOptionResponse Int
pHttpStatus_ =
UpdateTagOptionResponse' :: Maybe TagOptionDetail -> Int -> UpdateTagOptionResponse
UpdateTagOptionResponse'
{ $sel:tagOptionDetail:UpdateTagOptionResponse' :: Maybe TagOptionDetail
tagOptionDetail =
Maybe TagOptionDetail
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateTagOptionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateTagOptionResponse_tagOptionDetail :: Lens.Lens' UpdateTagOptionResponse (Prelude.Maybe TagOptionDetail)
updateTagOptionResponse_tagOptionDetail :: (Maybe TagOptionDetail -> f (Maybe TagOptionDetail))
-> UpdateTagOptionResponse -> f UpdateTagOptionResponse
updateTagOptionResponse_tagOptionDetail = (UpdateTagOptionResponse -> Maybe TagOptionDetail)
-> (UpdateTagOptionResponse
-> Maybe TagOptionDetail -> UpdateTagOptionResponse)
-> Lens
UpdateTagOptionResponse
UpdateTagOptionResponse
(Maybe TagOptionDetail)
(Maybe TagOptionDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagOptionResponse' {Maybe TagOptionDetail
tagOptionDetail :: Maybe TagOptionDetail
$sel:tagOptionDetail:UpdateTagOptionResponse' :: UpdateTagOptionResponse -> Maybe TagOptionDetail
tagOptionDetail} -> Maybe TagOptionDetail
tagOptionDetail) (\s :: UpdateTagOptionResponse
s@UpdateTagOptionResponse' {} Maybe TagOptionDetail
a -> UpdateTagOptionResponse
s {$sel:tagOptionDetail:UpdateTagOptionResponse' :: Maybe TagOptionDetail
tagOptionDetail = Maybe TagOptionDetail
a} :: UpdateTagOptionResponse)
updateTagOptionResponse_httpStatus :: Lens.Lens' UpdateTagOptionResponse Prelude.Int
updateTagOptionResponse_httpStatus :: (Int -> f Int)
-> UpdateTagOptionResponse -> f UpdateTagOptionResponse
updateTagOptionResponse_httpStatus = (UpdateTagOptionResponse -> Int)
-> (UpdateTagOptionResponse -> Int -> UpdateTagOptionResponse)
-> Lens UpdateTagOptionResponse UpdateTagOptionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTagOptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTagOptionResponse' :: UpdateTagOptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateTagOptionResponse
s@UpdateTagOptionResponse' {} Int
a -> UpdateTagOptionResponse
s {$sel:httpStatus:UpdateTagOptionResponse' :: Int
httpStatus = Int
a} :: UpdateTagOptionResponse)
instance Prelude.NFData UpdateTagOptionResponse