{-# 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.LicenseManager.UpdateServiceSettings
(
UpdateServiceSettings (..),
newUpdateServiceSettings,
updateServiceSettings_enableCrossAccountsDiscovery,
updateServiceSettings_snsTopicArn,
updateServiceSettings_s3BucketArn,
updateServiceSettings_organizationConfiguration,
UpdateServiceSettingsResponse (..),
newUpdateServiceSettingsResponse,
updateServiceSettingsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LicenseManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateServiceSettings = UpdateServiceSettings'
{
UpdateServiceSettings -> Maybe Bool
enableCrossAccountsDiscovery :: Prelude.Maybe Prelude.Bool,
UpdateServiceSettings -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
UpdateServiceSettings -> Maybe Text
s3BucketArn :: Prelude.Maybe Prelude.Text,
UpdateServiceSettings -> Maybe OrganizationConfiguration
organizationConfiguration :: Prelude.Maybe OrganizationConfiguration
}
deriving (UpdateServiceSettings -> UpdateServiceSettings -> Bool
(UpdateServiceSettings -> UpdateServiceSettings -> Bool)
-> (UpdateServiceSettings -> UpdateServiceSettings -> Bool)
-> Eq UpdateServiceSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
$c/= :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
== :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
$c== :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
Prelude.Eq, ReadPrec [UpdateServiceSettings]
ReadPrec UpdateServiceSettings
Int -> ReadS UpdateServiceSettings
ReadS [UpdateServiceSettings]
(Int -> ReadS UpdateServiceSettings)
-> ReadS [UpdateServiceSettings]
-> ReadPrec UpdateServiceSettings
-> ReadPrec [UpdateServiceSettings]
-> Read UpdateServiceSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceSettings]
$creadListPrec :: ReadPrec [UpdateServiceSettings]
readPrec :: ReadPrec UpdateServiceSettings
$creadPrec :: ReadPrec UpdateServiceSettings
readList :: ReadS [UpdateServiceSettings]
$creadList :: ReadS [UpdateServiceSettings]
readsPrec :: Int -> ReadS UpdateServiceSettings
$creadsPrec :: Int -> ReadS UpdateServiceSettings
Prelude.Read, Int -> UpdateServiceSettings -> ShowS
[UpdateServiceSettings] -> ShowS
UpdateServiceSettings -> String
(Int -> UpdateServiceSettings -> ShowS)
-> (UpdateServiceSettings -> String)
-> ([UpdateServiceSettings] -> ShowS)
-> Show UpdateServiceSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceSettings] -> ShowS
$cshowList :: [UpdateServiceSettings] -> ShowS
show :: UpdateServiceSettings -> String
$cshow :: UpdateServiceSettings -> String
showsPrec :: Int -> UpdateServiceSettings -> ShowS
$cshowsPrec :: Int -> UpdateServiceSettings -> ShowS
Prelude.Show, (forall x. UpdateServiceSettings -> Rep UpdateServiceSettings x)
-> (forall x. Rep UpdateServiceSettings x -> UpdateServiceSettings)
-> Generic UpdateServiceSettings
forall x. Rep UpdateServiceSettings x -> UpdateServiceSettings
forall x. UpdateServiceSettings -> Rep UpdateServiceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServiceSettings x -> UpdateServiceSettings
$cfrom :: forall x. UpdateServiceSettings -> Rep UpdateServiceSettings x
Prelude.Generic)
newUpdateServiceSettings ::
UpdateServiceSettings
newUpdateServiceSettings :: UpdateServiceSettings
newUpdateServiceSettings =
UpdateServiceSettings' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe OrganizationConfiguration
-> UpdateServiceSettings
UpdateServiceSettings'
{ $sel:enableCrossAccountsDiscovery:UpdateServiceSettings' :: Maybe Bool
enableCrossAccountsDiscovery =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:snsTopicArn:UpdateServiceSettings' :: Maybe Text
snsTopicArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3BucketArn:UpdateServiceSettings' :: Maybe Text
s3BucketArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:organizationConfiguration:UpdateServiceSettings' :: Maybe OrganizationConfiguration
organizationConfiguration = Maybe OrganizationConfiguration
forall a. Maybe a
Prelude.Nothing
}
updateServiceSettings_enableCrossAccountsDiscovery :: Lens.Lens' UpdateServiceSettings (Prelude.Maybe Prelude.Bool)
updateServiceSettings_enableCrossAccountsDiscovery :: (Maybe Bool -> f (Maybe Bool))
-> UpdateServiceSettings -> f UpdateServiceSettings
updateServiceSettings_enableCrossAccountsDiscovery = (UpdateServiceSettings -> Maybe Bool)
-> (UpdateServiceSettings -> Maybe Bool -> UpdateServiceSettings)
-> Lens
UpdateServiceSettings
UpdateServiceSettings
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {Maybe Bool
enableCrossAccountsDiscovery :: Maybe Bool
$sel:enableCrossAccountsDiscovery:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Bool
enableCrossAccountsDiscovery} -> Maybe Bool
enableCrossAccountsDiscovery) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} Maybe Bool
a -> UpdateServiceSettings
s {$sel:enableCrossAccountsDiscovery:UpdateServiceSettings' :: Maybe Bool
enableCrossAccountsDiscovery = Maybe Bool
a} :: UpdateServiceSettings)
updateServiceSettings_snsTopicArn :: Lens.Lens' UpdateServiceSettings (Prelude.Maybe Prelude.Text)
updateServiceSettings_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> UpdateServiceSettings -> f UpdateServiceSettings
updateServiceSettings_snsTopicArn = (UpdateServiceSettings -> Maybe Text)
-> (UpdateServiceSettings -> Maybe Text -> UpdateServiceSettings)
-> Lens
UpdateServiceSettings
UpdateServiceSettings
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} Maybe Text
a -> UpdateServiceSettings
s {$sel:snsTopicArn:UpdateServiceSettings' :: Maybe Text
snsTopicArn = Maybe Text
a} :: UpdateServiceSettings)
updateServiceSettings_s3BucketArn :: Lens.Lens' UpdateServiceSettings (Prelude.Maybe Prelude.Text)
updateServiceSettings_s3BucketArn :: (Maybe Text -> f (Maybe Text))
-> UpdateServiceSettings -> f UpdateServiceSettings
updateServiceSettings_s3BucketArn = (UpdateServiceSettings -> Maybe Text)
-> (UpdateServiceSettings -> Maybe Text -> UpdateServiceSettings)
-> Lens
UpdateServiceSettings
UpdateServiceSettings
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {Maybe Text
s3BucketArn :: Maybe Text
$sel:s3BucketArn:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Text
s3BucketArn} -> Maybe Text
s3BucketArn) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} Maybe Text
a -> UpdateServiceSettings
s {$sel:s3BucketArn:UpdateServiceSettings' :: Maybe Text
s3BucketArn = Maybe Text
a} :: UpdateServiceSettings)
updateServiceSettings_organizationConfiguration :: Lens.Lens' UpdateServiceSettings (Prelude.Maybe OrganizationConfiguration)
updateServiceSettings_organizationConfiguration :: (Maybe OrganizationConfiguration
-> f (Maybe OrganizationConfiguration))
-> UpdateServiceSettings -> f UpdateServiceSettings
updateServiceSettings_organizationConfiguration = (UpdateServiceSettings -> Maybe OrganizationConfiguration)
-> (UpdateServiceSettings
-> Maybe OrganizationConfiguration -> UpdateServiceSettings)
-> Lens
UpdateServiceSettings
UpdateServiceSettings
(Maybe OrganizationConfiguration)
(Maybe OrganizationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {Maybe OrganizationConfiguration
organizationConfiguration :: Maybe OrganizationConfiguration
$sel:organizationConfiguration:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe OrganizationConfiguration
organizationConfiguration} -> Maybe OrganizationConfiguration
organizationConfiguration) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} Maybe OrganizationConfiguration
a -> UpdateServiceSettings
s {$sel:organizationConfiguration:UpdateServiceSettings' :: Maybe OrganizationConfiguration
organizationConfiguration = Maybe OrganizationConfiguration
a} :: UpdateServiceSettings)
instance Core.AWSRequest UpdateServiceSettings where
type
AWSResponse UpdateServiceSettings =
UpdateServiceSettingsResponse
request :: UpdateServiceSettings -> Request UpdateServiceSettings
request = Service -> UpdateServiceSettings -> Request UpdateServiceSettings
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateServiceSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceSettings)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateServiceSettings))
-> Logger
-> Service
-> Proxy UpdateServiceSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceSettings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateServiceSettingsResponse
UpdateServiceSettingsResponse'
(Int -> UpdateServiceSettingsResponse)
-> Either String Int -> Either String UpdateServiceSettingsResponse
forall (f :: * -> *) a b. Functor 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 UpdateServiceSettings
instance Prelude.NFData UpdateServiceSettings
instance Core.ToHeaders UpdateServiceSettings where
toHeaders :: UpdateServiceSettings -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateServiceSettings -> 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
"AWSLicenseManager.UpdateServiceSettings" ::
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 UpdateServiceSettings where
toJSON :: UpdateServiceSettings -> Value
toJSON UpdateServiceSettings' {Maybe Bool
Maybe Text
Maybe OrganizationConfiguration
organizationConfiguration :: Maybe OrganizationConfiguration
s3BucketArn :: Maybe Text
snsTopicArn :: Maybe Text
enableCrossAccountsDiscovery :: Maybe Bool
$sel:organizationConfiguration:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe OrganizationConfiguration
$sel:s3BucketArn:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Text
$sel:snsTopicArn:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Text
$sel:enableCrossAccountsDiscovery:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EnableCrossAccountsDiscovery" 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
enableCrossAccountsDiscovery,
(Text
"SnsTopicArn" 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
snsTopicArn,
(Text
"S3BucketArn" 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
s3BucketArn,
(Text
"OrganizationConfiguration" Text -> OrganizationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(OrganizationConfiguration -> Pair)
-> Maybe OrganizationConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OrganizationConfiguration
organizationConfiguration
]
)
instance Core.ToPath UpdateServiceSettings where
toPath :: UpdateServiceSettings -> ByteString
toPath = ByteString -> UpdateServiceSettings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateServiceSettings where
toQuery :: UpdateServiceSettings -> QueryString
toQuery = QueryString -> UpdateServiceSettings -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateServiceSettingsResponse = UpdateServiceSettingsResponse'
{
UpdateServiceSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
(UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool)
-> (UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool)
-> Eq UpdateServiceSettingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
$c/= :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
== :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
$c== :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServiceSettingsResponse]
ReadPrec UpdateServiceSettingsResponse
Int -> ReadS UpdateServiceSettingsResponse
ReadS [UpdateServiceSettingsResponse]
(Int -> ReadS UpdateServiceSettingsResponse)
-> ReadS [UpdateServiceSettingsResponse]
-> ReadPrec UpdateServiceSettingsResponse
-> ReadPrec [UpdateServiceSettingsResponse]
-> Read UpdateServiceSettingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceSettingsResponse]
$creadListPrec :: ReadPrec [UpdateServiceSettingsResponse]
readPrec :: ReadPrec UpdateServiceSettingsResponse
$creadPrec :: ReadPrec UpdateServiceSettingsResponse
readList :: ReadS [UpdateServiceSettingsResponse]
$creadList :: ReadS [UpdateServiceSettingsResponse]
readsPrec :: Int -> ReadS UpdateServiceSettingsResponse
$creadsPrec :: Int -> ReadS UpdateServiceSettingsResponse
Prelude.Read, Int -> UpdateServiceSettingsResponse -> ShowS
[UpdateServiceSettingsResponse] -> ShowS
UpdateServiceSettingsResponse -> String
(Int -> UpdateServiceSettingsResponse -> ShowS)
-> (UpdateServiceSettingsResponse -> String)
-> ([UpdateServiceSettingsResponse] -> ShowS)
-> Show UpdateServiceSettingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceSettingsResponse] -> ShowS
$cshowList :: [UpdateServiceSettingsResponse] -> ShowS
show :: UpdateServiceSettingsResponse -> String
$cshow :: UpdateServiceSettingsResponse -> String
showsPrec :: Int -> UpdateServiceSettingsResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceSettingsResponse -> ShowS
Prelude.Show, (forall x.
UpdateServiceSettingsResponse
-> Rep UpdateServiceSettingsResponse x)
-> (forall x.
Rep UpdateServiceSettingsResponse x
-> UpdateServiceSettingsResponse)
-> Generic UpdateServiceSettingsResponse
forall x.
Rep UpdateServiceSettingsResponse x
-> UpdateServiceSettingsResponse
forall x.
UpdateServiceSettingsResponse
-> Rep UpdateServiceSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceSettingsResponse x
-> UpdateServiceSettingsResponse
$cfrom :: forall x.
UpdateServiceSettingsResponse
-> Rep UpdateServiceSettingsResponse x
Prelude.Generic)
newUpdateServiceSettingsResponse ::
Prelude.Int ->
UpdateServiceSettingsResponse
newUpdateServiceSettingsResponse :: Int -> UpdateServiceSettingsResponse
newUpdateServiceSettingsResponse Int
pHttpStatus_ =
UpdateServiceSettingsResponse' :: Int -> UpdateServiceSettingsResponse
UpdateServiceSettingsResponse'
{ $sel:httpStatus:UpdateServiceSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateServiceSettingsResponse_httpStatus :: Lens.Lens' UpdateServiceSettingsResponse Prelude.Int
updateServiceSettingsResponse_httpStatus :: (Int -> f Int)
-> UpdateServiceSettingsResponse -> f UpdateServiceSettingsResponse
updateServiceSettingsResponse_httpStatus = (UpdateServiceSettingsResponse -> Int)
-> (UpdateServiceSettingsResponse
-> Int -> UpdateServiceSettingsResponse)
-> Lens
UpdateServiceSettingsResponse UpdateServiceSettingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServiceSettingsResponse
s@UpdateServiceSettingsResponse' {} Int
a -> UpdateServiceSettingsResponse
s {$sel:httpStatus:UpdateServiceSettingsResponse' :: Int
httpStatus = Int
a} :: UpdateServiceSettingsResponse)
instance Prelude.NFData UpdateServiceSettingsResponse