{-# 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.QuickSight.UpdatePublicSharingSettings
(
UpdatePublicSharingSettings (..),
newUpdatePublicSharingSettings,
updatePublicSharingSettings_publicSharingEnabled,
updatePublicSharingSettings_awsAccountId,
UpdatePublicSharingSettingsResponse (..),
newUpdatePublicSharingSettingsResponse,
updatePublicSharingSettingsResponse_requestId,
updatePublicSharingSettingsResponse_status,
)
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 Amazonka.QuickSight.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdatePublicSharingSettings = UpdatePublicSharingSettings'
{
UpdatePublicSharingSettings -> Maybe Bool
publicSharingEnabled :: Prelude.Maybe Prelude.Bool,
UpdatePublicSharingSettings -> Text
awsAccountId :: Prelude.Text
}
deriving (UpdatePublicSharingSettings -> UpdatePublicSharingSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePublicSharingSettings -> UpdatePublicSharingSettings -> Bool
$c/= :: UpdatePublicSharingSettings -> UpdatePublicSharingSettings -> Bool
== :: UpdatePublicSharingSettings -> UpdatePublicSharingSettings -> Bool
$c== :: UpdatePublicSharingSettings -> UpdatePublicSharingSettings -> Bool
Prelude.Eq, ReadPrec [UpdatePublicSharingSettings]
ReadPrec UpdatePublicSharingSettings
Int -> ReadS UpdatePublicSharingSettings
ReadS [UpdatePublicSharingSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePublicSharingSettings]
$creadListPrec :: ReadPrec [UpdatePublicSharingSettings]
readPrec :: ReadPrec UpdatePublicSharingSettings
$creadPrec :: ReadPrec UpdatePublicSharingSettings
readList :: ReadS [UpdatePublicSharingSettings]
$creadList :: ReadS [UpdatePublicSharingSettings]
readsPrec :: Int -> ReadS UpdatePublicSharingSettings
$creadsPrec :: Int -> ReadS UpdatePublicSharingSettings
Prelude.Read, Int -> UpdatePublicSharingSettings -> ShowS
[UpdatePublicSharingSettings] -> ShowS
UpdatePublicSharingSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePublicSharingSettings] -> ShowS
$cshowList :: [UpdatePublicSharingSettings] -> ShowS
show :: UpdatePublicSharingSettings -> String
$cshow :: UpdatePublicSharingSettings -> String
showsPrec :: Int -> UpdatePublicSharingSettings -> ShowS
$cshowsPrec :: Int -> UpdatePublicSharingSettings -> ShowS
Prelude.Show, forall x.
Rep UpdatePublicSharingSettings x -> UpdatePublicSharingSettings
forall x.
UpdatePublicSharingSettings -> Rep UpdatePublicSharingSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePublicSharingSettings x -> UpdatePublicSharingSettings
$cfrom :: forall x.
UpdatePublicSharingSettings -> Rep UpdatePublicSharingSettings x
Prelude.Generic)
newUpdatePublicSharingSettings ::
Prelude.Text ->
UpdatePublicSharingSettings
newUpdatePublicSharingSettings :: Text -> UpdatePublicSharingSettings
newUpdatePublicSharingSettings Text
pAwsAccountId_ =
UpdatePublicSharingSettings'
{ $sel:publicSharingEnabled:UpdatePublicSharingSettings' :: Maybe Bool
publicSharingEnabled =
forall a. Maybe a
Prelude.Nothing,
$sel:awsAccountId:UpdatePublicSharingSettings' :: Text
awsAccountId = Text
pAwsAccountId_
}
updatePublicSharingSettings_publicSharingEnabled :: Lens.Lens' UpdatePublicSharingSettings (Prelude.Maybe Prelude.Bool)
updatePublicSharingSettings_publicSharingEnabled :: Lens' UpdatePublicSharingSettings (Maybe Bool)
updatePublicSharingSettings_publicSharingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePublicSharingSettings' {Maybe Bool
publicSharingEnabled :: Maybe Bool
$sel:publicSharingEnabled:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Maybe Bool
publicSharingEnabled} -> Maybe Bool
publicSharingEnabled) (\s :: UpdatePublicSharingSettings
s@UpdatePublicSharingSettings' {} Maybe Bool
a -> UpdatePublicSharingSettings
s {$sel:publicSharingEnabled:UpdatePublicSharingSettings' :: Maybe Bool
publicSharingEnabled = Maybe Bool
a} :: UpdatePublicSharingSettings)
updatePublicSharingSettings_awsAccountId :: Lens.Lens' UpdatePublicSharingSettings Prelude.Text
updatePublicSharingSettings_awsAccountId :: Lens' UpdatePublicSharingSettings Text
updatePublicSharingSettings_awsAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePublicSharingSettings' {Text
awsAccountId :: Text
$sel:awsAccountId:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Text
awsAccountId} -> Text
awsAccountId) (\s :: UpdatePublicSharingSettings
s@UpdatePublicSharingSettings' {} Text
a -> UpdatePublicSharingSettings
s {$sel:awsAccountId:UpdatePublicSharingSettings' :: Text
awsAccountId = Text
a} :: UpdatePublicSharingSettings)
instance Core.AWSRequest UpdatePublicSharingSettings where
type
AWSResponse UpdatePublicSharingSettings =
UpdatePublicSharingSettingsResponse
request :: (Service -> Service)
-> UpdatePublicSharingSettings
-> Request UpdatePublicSharingSettings
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 UpdatePublicSharingSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePublicSharingSettings)))
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 -> Int -> UpdatePublicSharingSettingsResponse
UpdatePublicSharingSettingsResponse'
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
"RequestId")
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 UpdatePublicSharingSettings where
hashWithSalt :: Int -> UpdatePublicSharingSettings -> Int
hashWithSalt Int
_salt UpdatePublicSharingSettings' {Maybe Bool
Text
awsAccountId :: Text
publicSharingEnabled :: Maybe Bool
$sel:awsAccountId:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Text
$sel:publicSharingEnabled:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
publicSharingEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
awsAccountId
instance Prelude.NFData UpdatePublicSharingSettings where
rnf :: UpdatePublicSharingSettings -> ()
rnf UpdatePublicSharingSettings' {Maybe Bool
Text
awsAccountId :: Text
publicSharingEnabled :: Maybe Bool
$sel:awsAccountId:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Text
$sel:publicSharingEnabled:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
publicSharingEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
awsAccountId
instance Data.ToHeaders UpdatePublicSharingSettings where
toHeaders :: UpdatePublicSharingSettings -> 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.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdatePublicSharingSettings where
toJSON :: UpdatePublicSharingSettings -> Value
toJSON UpdatePublicSharingSettings' {Maybe Bool
Text
awsAccountId :: Text
publicSharingEnabled :: Maybe Bool
$sel:awsAccountId:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Text
$sel:publicSharingEnabled:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"PublicSharingEnabled" 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
publicSharingEnabled
]
)
instance Data.ToPath UpdatePublicSharingSettings where
toPath :: UpdatePublicSharingSettings -> ByteString
toPath UpdatePublicSharingSettings' {Maybe Bool
Text
awsAccountId :: Text
publicSharingEnabled :: Maybe Bool
$sel:awsAccountId:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Text
$sel:publicSharingEnabled:UpdatePublicSharingSettings' :: UpdatePublicSharingSettings -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/accounts/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
awsAccountId,
ByteString
"/public-sharing-settings"
]
instance Data.ToQuery UpdatePublicSharingSettings where
toQuery :: UpdatePublicSharingSettings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdatePublicSharingSettingsResponse = UpdatePublicSharingSettingsResponse'
{
UpdatePublicSharingSettingsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
UpdatePublicSharingSettingsResponse -> Int
status :: Prelude.Int
}
deriving (UpdatePublicSharingSettingsResponse
-> UpdatePublicSharingSettingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePublicSharingSettingsResponse
-> UpdatePublicSharingSettingsResponse -> Bool
$c/= :: UpdatePublicSharingSettingsResponse
-> UpdatePublicSharingSettingsResponse -> Bool
== :: UpdatePublicSharingSettingsResponse
-> UpdatePublicSharingSettingsResponse -> Bool
$c== :: UpdatePublicSharingSettingsResponse
-> UpdatePublicSharingSettingsResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePublicSharingSettingsResponse]
ReadPrec UpdatePublicSharingSettingsResponse
Int -> ReadS UpdatePublicSharingSettingsResponse
ReadS [UpdatePublicSharingSettingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePublicSharingSettingsResponse]
$creadListPrec :: ReadPrec [UpdatePublicSharingSettingsResponse]
readPrec :: ReadPrec UpdatePublicSharingSettingsResponse
$creadPrec :: ReadPrec UpdatePublicSharingSettingsResponse
readList :: ReadS [UpdatePublicSharingSettingsResponse]
$creadList :: ReadS [UpdatePublicSharingSettingsResponse]
readsPrec :: Int -> ReadS UpdatePublicSharingSettingsResponse
$creadsPrec :: Int -> ReadS UpdatePublicSharingSettingsResponse
Prelude.Read, Int -> UpdatePublicSharingSettingsResponse -> ShowS
[UpdatePublicSharingSettingsResponse] -> ShowS
UpdatePublicSharingSettingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePublicSharingSettingsResponse] -> ShowS
$cshowList :: [UpdatePublicSharingSettingsResponse] -> ShowS
show :: UpdatePublicSharingSettingsResponse -> String
$cshow :: UpdatePublicSharingSettingsResponse -> String
showsPrec :: Int -> UpdatePublicSharingSettingsResponse -> ShowS
$cshowsPrec :: Int -> UpdatePublicSharingSettingsResponse -> ShowS
Prelude.Show, forall x.
Rep UpdatePublicSharingSettingsResponse x
-> UpdatePublicSharingSettingsResponse
forall x.
UpdatePublicSharingSettingsResponse
-> Rep UpdatePublicSharingSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePublicSharingSettingsResponse x
-> UpdatePublicSharingSettingsResponse
$cfrom :: forall x.
UpdatePublicSharingSettingsResponse
-> Rep UpdatePublicSharingSettingsResponse x
Prelude.Generic)
newUpdatePublicSharingSettingsResponse ::
Prelude.Int ->
UpdatePublicSharingSettingsResponse
newUpdatePublicSharingSettingsResponse :: Int -> UpdatePublicSharingSettingsResponse
newUpdatePublicSharingSettingsResponse Int
pStatus_ =
UpdatePublicSharingSettingsResponse'
{ $sel:requestId:UpdatePublicSharingSettingsResponse' :: Maybe Text
requestId =
forall a. Maybe a
Prelude.Nothing,
$sel:status:UpdatePublicSharingSettingsResponse' :: Int
status = Int
pStatus_
}
updatePublicSharingSettingsResponse_requestId :: Lens.Lens' UpdatePublicSharingSettingsResponse (Prelude.Maybe Prelude.Text)
updatePublicSharingSettingsResponse_requestId :: Lens' UpdatePublicSharingSettingsResponse (Maybe Text)
updatePublicSharingSettingsResponse_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePublicSharingSettingsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:UpdatePublicSharingSettingsResponse' :: UpdatePublicSharingSettingsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: UpdatePublicSharingSettingsResponse
s@UpdatePublicSharingSettingsResponse' {} Maybe Text
a -> UpdatePublicSharingSettingsResponse
s {$sel:requestId:UpdatePublicSharingSettingsResponse' :: Maybe Text
requestId = Maybe Text
a} :: UpdatePublicSharingSettingsResponse)
updatePublicSharingSettingsResponse_status :: Lens.Lens' UpdatePublicSharingSettingsResponse Prelude.Int
updatePublicSharingSettingsResponse_status :: Lens' UpdatePublicSharingSettingsResponse Int
updatePublicSharingSettingsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePublicSharingSettingsResponse' {Int
status :: Int
$sel:status:UpdatePublicSharingSettingsResponse' :: UpdatePublicSharingSettingsResponse -> Int
status} -> Int
status) (\s :: UpdatePublicSharingSettingsResponse
s@UpdatePublicSharingSettingsResponse' {} Int
a -> UpdatePublicSharingSettingsResponse
s {$sel:status:UpdatePublicSharingSettingsResponse' :: Int
status = Int
a} :: UpdatePublicSharingSettingsResponse)
instance
Prelude.NFData
UpdatePublicSharingSettingsResponse
where
rnf :: UpdatePublicSharingSettingsResponse -> ()
rnf UpdatePublicSharingSettingsResponse' {Int
Maybe Text
status :: Int
requestId :: Maybe Text
$sel:status:UpdatePublicSharingSettingsResponse' :: UpdatePublicSharingSettingsResponse -> Int
$sel:requestId:UpdatePublicSharingSettingsResponse' :: UpdatePublicSharingSettingsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
requestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
status