{-# 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_active,
updateTagOption_value,
updateTagOption_id,
UpdateTagOptionResponse (..),
newUpdateTagOptionResponse,
updateTagOptionResponse_tagOptionDetail,
updateTagOptionResponse_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.ServiceCatalog.Types
data UpdateTagOption = UpdateTagOption'
{
UpdateTagOption -> Maybe Bool
active :: Prelude.Maybe Prelude.Bool,
UpdateTagOption -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
UpdateTagOption -> Text
id :: Prelude.Text
}
deriving (UpdateTagOption -> UpdateTagOption -> Bool
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]
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
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. 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'
{ $sel:active:UpdateTagOption' :: Maybe Bool
active = forall a. Maybe a
Prelude.Nothing,
$sel:value:UpdateTagOption' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing,
$sel:id:UpdateTagOption' :: Text
id = Text
pId_
}
updateTagOption_active :: Lens.Lens' UpdateTagOption (Prelude.Maybe Prelude.Bool)
updateTagOption_active :: Lens' UpdateTagOption (Maybe Bool)
updateTagOption_active = 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_value :: Lens.Lens' UpdateTagOption (Prelude.Maybe Prelude.Text)
updateTagOption_value :: Lens' UpdateTagOption (Maybe Text)
updateTagOption_value = 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_id :: Lens.Lens' UpdateTagOption Prelude.Text
updateTagOption_id :: Lens' UpdateTagOption Text
updateTagOption_id = 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 :: (Service -> Service) -> UpdateTagOption -> Request UpdateTagOption
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateTagOption
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTagOption)))
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 TagOptionDetail -> Int -> UpdateTagOptionResponse
UpdateTagOptionResponse'
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
"TagOptionDetail")
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 UpdateTagOption where
hashWithSalt :: Int -> UpdateTagOption -> Int
hashWithSalt Int
_salt UpdateTagOption' {Maybe Bool
Maybe Text
Text
id :: Text
value :: Maybe Text
active :: Maybe Bool
$sel:id:UpdateTagOption' :: UpdateTagOption -> Text
$sel:value:UpdateTagOption' :: UpdateTagOption -> Maybe Text
$sel:active:UpdateTagOption' :: UpdateTagOption -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
active
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData UpdateTagOption where
rnf :: UpdateTagOption -> ()
rnf UpdateTagOption' {Maybe Bool
Maybe Text
Text
id :: Text
value :: Maybe Text
active :: Maybe Bool
$sel:id:UpdateTagOption' :: UpdateTagOption -> Text
$sel:value:UpdateTagOption' :: UpdateTagOption -> Maybe Text
$sel:active:UpdateTagOption' :: UpdateTagOption -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
active
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders UpdateTagOption where
toHeaders :: UpdateTagOption -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWS242ServiceCatalogService.UpdateTagOption" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateTagOption where
toJSON :: UpdateTagOption -> Value
toJSON UpdateTagOption' {Maybe Bool
Maybe Text
Text
id :: Text
value :: Maybe Text
active :: Maybe Bool
$sel:id:UpdateTagOption' :: UpdateTagOption -> Text
$sel:value:UpdateTagOption' :: UpdateTagOption -> Maybe Text
$sel:active:UpdateTagOption' :: UpdateTagOption -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Active" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
active,
(Key
"Value" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value,
forall a. a -> Maybe a
Prelude.Just (Key
"Id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id)
]
)
instance Data.ToPath UpdateTagOption where
toPath :: UpdateTagOption -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateTagOption where
toQuery :: UpdateTagOption -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
{ $sel:tagOptionDetail:UpdateTagOptionResponse' :: Maybe TagOptionDetail
tagOptionDetail =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateTagOptionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateTagOptionResponse_tagOptionDetail :: Lens.Lens' UpdateTagOptionResponse (Prelude.Maybe TagOptionDetail)
updateTagOptionResponse_tagOptionDetail :: Lens' UpdateTagOptionResponse (Maybe TagOptionDetail)
updateTagOptionResponse_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 :: Lens' UpdateTagOptionResponse Int
updateTagOptionResponse_httpStatus = 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 where
rnf :: UpdateTagOptionResponse -> ()
rnf UpdateTagOptionResponse' {Int
Maybe TagOptionDetail
httpStatus :: Int
tagOptionDetail :: Maybe TagOptionDetail
$sel:httpStatus:UpdateTagOptionResponse' :: UpdateTagOptionResponse -> Int
$sel:tagOptionDetail:UpdateTagOptionResponse' :: UpdateTagOptionResponse -> Maybe TagOptionDetail
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TagOptionDetail
tagOptionDetail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus