{-# 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.CloudSearch.UpdateServiceAccessPolicies
(
UpdateServiceAccessPolicies (..),
newUpdateServiceAccessPolicies,
updateServiceAccessPolicies_domainName,
updateServiceAccessPolicies_accessPolicies,
UpdateServiceAccessPoliciesResponse (..),
newUpdateServiceAccessPoliciesResponse,
updateServiceAccessPoliciesResponse_httpStatus,
updateServiceAccessPoliciesResponse_accessPolicies,
)
where
import Amazonka.CloudSearch.Types
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
data UpdateServiceAccessPolicies = UpdateServiceAccessPolicies'
{ UpdateServiceAccessPolicies -> Text
domainName :: Prelude.Text,
UpdateServiceAccessPolicies -> Text
accessPolicies :: Prelude.Text
}
deriving (UpdateServiceAccessPolicies -> UpdateServiceAccessPolicies -> Bool
(UpdateServiceAccessPolicies
-> UpdateServiceAccessPolicies -> Bool)
-> (UpdateServiceAccessPolicies
-> UpdateServiceAccessPolicies -> Bool)
-> Eq UpdateServiceAccessPolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceAccessPolicies -> UpdateServiceAccessPolicies -> Bool
$c/= :: UpdateServiceAccessPolicies -> UpdateServiceAccessPolicies -> Bool
== :: UpdateServiceAccessPolicies -> UpdateServiceAccessPolicies -> Bool
$c== :: UpdateServiceAccessPolicies -> UpdateServiceAccessPolicies -> Bool
Prelude.Eq, ReadPrec [UpdateServiceAccessPolicies]
ReadPrec UpdateServiceAccessPolicies
Int -> ReadS UpdateServiceAccessPolicies
ReadS [UpdateServiceAccessPolicies]
(Int -> ReadS UpdateServiceAccessPolicies)
-> ReadS [UpdateServiceAccessPolicies]
-> ReadPrec UpdateServiceAccessPolicies
-> ReadPrec [UpdateServiceAccessPolicies]
-> Read UpdateServiceAccessPolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceAccessPolicies]
$creadListPrec :: ReadPrec [UpdateServiceAccessPolicies]
readPrec :: ReadPrec UpdateServiceAccessPolicies
$creadPrec :: ReadPrec UpdateServiceAccessPolicies
readList :: ReadS [UpdateServiceAccessPolicies]
$creadList :: ReadS [UpdateServiceAccessPolicies]
readsPrec :: Int -> ReadS UpdateServiceAccessPolicies
$creadsPrec :: Int -> ReadS UpdateServiceAccessPolicies
Prelude.Read, Int -> UpdateServiceAccessPolicies -> ShowS
[UpdateServiceAccessPolicies] -> ShowS
UpdateServiceAccessPolicies -> String
(Int -> UpdateServiceAccessPolicies -> ShowS)
-> (UpdateServiceAccessPolicies -> String)
-> ([UpdateServiceAccessPolicies] -> ShowS)
-> Show UpdateServiceAccessPolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceAccessPolicies] -> ShowS
$cshowList :: [UpdateServiceAccessPolicies] -> ShowS
show :: UpdateServiceAccessPolicies -> String
$cshow :: UpdateServiceAccessPolicies -> String
showsPrec :: Int -> UpdateServiceAccessPolicies -> ShowS
$cshowsPrec :: Int -> UpdateServiceAccessPolicies -> ShowS
Prelude.Show, (forall x.
UpdateServiceAccessPolicies -> Rep UpdateServiceAccessPolicies x)
-> (forall x.
Rep UpdateServiceAccessPolicies x -> UpdateServiceAccessPolicies)
-> Generic UpdateServiceAccessPolicies
forall x.
Rep UpdateServiceAccessPolicies x -> UpdateServiceAccessPolicies
forall x.
UpdateServiceAccessPolicies -> Rep UpdateServiceAccessPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceAccessPolicies x -> UpdateServiceAccessPolicies
$cfrom :: forall x.
UpdateServiceAccessPolicies -> Rep UpdateServiceAccessPolicies x
Prelude.Generic)
newUpdateServiceAccessPolicies ::
Prelude.Text ->
Prelude.Text ->
UpdateServiceAccessPolicies
newUpdateServiceAccessPolicies :: Text -> Text -> UpdateServiceAccessPolicies
newUpdateServiceAccessPolicies
Text
pDomainName_
Text
pAccessPolicies_ =
UpdateServiceAccessPolicies' :: Text -> Text -> UpdateServiceAccessPolicies
UpdateServiceAccessPolicies'
{ $sel:domainName:UpdateServiceAccessPolicies' :: Text
domainName =
Text
pDomainName_,
$sel:accessPolicies:UpdateServiceAccessPolicies' :: Text
accessPolicies = Text
pAccessPolicies_
}
updateServiceAccessPolicies_domainName :: Lens.Lens' UpdateServiceAccessPolicies Prelude.Text
updateServiceAccessPolicies_domainName :: (Text -> f Text)
-> UpdateServiceAccessPolicies -> f UpdateServiceAccessPolicies
updateServiceAccessPolicies_domainName = (UpdateServiceAccessPolicies -> Text)
-> (UpdateServiceAccessPolicies
-> Text -> UpdateServiceAccessPolicies)
-> Lens
UpdateServiceAccessPolicies UpdateServiceAccessPolicies Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceAccessPolicies' {Text
domainName :: Text
$sel:domainName:UpdateServiceAccessPolicies' :: UpdateServiceAccessPolicies -> Text
domainName} -> Text
domainName) (\s :: UpdateServiceAccessPolicies
s@UpdateServiceAccessPolicies' {} Text
a -> UpdateServiceAccessPolicies
s {$sel:domainName:UpdateServiceAccessPolicies' :: Text
domainName = Text
a} :: UpdateServiceAccessPolicies)
updateServiceAccessPolicies_accessPolicies :: Lens.Lens' UpdateServiceAccessPolicies Prelude.Text
updateServiceAccessPolicies_accessPolicies :: (Text -> f Text)
-> UpdateServiceAccessPolicies -> f UpdateServiceAccessPolicies
updateServiceAccessPolicies_accessPolicies = (UpdateServiceAccessPolicies -> Text)
-> (UpdateServiceAccessPolicies
-> Text -> UpdateServiceAccessPolicies)
-> Lens
UpdateServiceAccessPolicies UpdateServiceAccessPolicies Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceAccessPolicies' {Text
accessPolicies :: Text
$sel:accessPolicies:UpdateServiceAccessPolicies' :: UpdateServiceAccessPolicies -> Text
accessPolicies} -> Text
accessPolicies) (\s :: UpdateServiceAccessPolicies
s@UpdateServiceAccessPolicies' {} Text
a -> UpdateServiceAccessPolicies
s {$sel:accessPolicies:UpdateServiceAccessPolicies' :: Text
accessPolicies = Text
a} :: UpdateServiceAccessPolicies)
instance Core.AWSRequest UpdateServiceAccessPolicies where
type
AWSResponse UpdateServiceAccessPolicies =
UpdateServiceAccessPoliciesResponse
request :: UpdateServiceAccessPolicies -> Request UpdateServiceAccessPolicies
request = Service
-> UpdateServiceAccessPolicies
-> Request UpdateServiceAccessPolicies
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateServiceAccessPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceAccessPolicies)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UpdateServiceAccessPolicies))
-> Logger
-> Service
-> Proxy UpdateServiceAccessPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateServiceAccessPolicies)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"UpdateServiceAccessPoliciesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse
UpdateServiceAccessPoliciesResponse'
(Int
-> AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse)
-> Either String Int
-> Either
String
(AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse)
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))
Either
String
(AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse)
-> Either String AccessPoliciesStatus
-> Either String UpdateServiceAccessPoliciesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String AccessPoliciesStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"AccessPolicies")
)
instance Prelude.Hashable UpdateServiceAccessPolicies
instance Prelude.NFData UpdateServiceAccessPolicies
instance Core.ToHeaders UpdateServiceAccessPolicies where
toHeaders :: UpdateServiceAccessPolicies -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateServiceAccessPolicies -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UpdateServiceAccessPolicies where
toPath :: UpdateServiceAccessPolicies -> ByteString
toPath = ByteString -> UpdateServiceAccessPolicies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateServiceAccessPolicies where
toQuery :: UpdateServiceAccessPolicies -> QueryString
toQuery UpdateServiceAccessPolicies' {Text
accessPolicies :: Text
domainName :: Text
$sel:accessPolicies:UpdateServiceAccessPolicies' :: UpdateServiceAccessPolicies -> Text
$sel:domainName:UpdateServiceAccessPolicies' :: UpdateServiceAccessPolicies -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"UpdateServiceAccessPolicies" ::
Prelude.ByteString
),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2013-01-01" :: Prelude.ByteString),
ByteString
"DomainName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
domainName,
ByteString
"AccessPolicies" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
accessPolicies
]
data UpdateServiceAccessPoliciesResponse = UpdateServiceAccessPoliciesResponse'
{
UpdateServiceAccessPoliciesResponse -> Int
httpStatus :: Prelude.Int,
UpdateServiceAccessPoliciesResponse -> AccessPoliciesStatus
accessPolicies :: AccessPoliciesStatus
}
deriving (UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool
(UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool)
-> (UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool)
-> Eq UpdateServiceAccessPoliciesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool
$c/= :: UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool
== :: UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool
$c== :: UpdateServiceAccessPoliciesResponse
-> UpdateServiceAccessPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServiceAccessPoliciesResponse]
ReadPrec UpdateServiceAccessPoliciesResponse
Int -> ReadS UpdateServiceAccessPoliciesResponse
ReadS [UpdateServiceAccessPoliciesResponse]
(Int -> ReadS UpdateServiceAccessPoliciesResponse)
-> ReadS [UpdateServiceAccessPoliciesResponse]
-> ReadPrec UpdateServiceAccessPoliciesResponse
-> ReadPrec [UpdateServiceAccessPoliciesResponse]
-> Read UpdateServiceAccessPoliciesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceAccessPoliciesResponse]
$creadListPrec :: ReadPrec [UpdateServiceAccessPoliciesResponse]
readPrec :: ReadPrec UpdateServiceAccessPoliciesResponse
$creadPrec :: ReadPrec UpdateServiceAccessPoliciesResponse
readList :: ReadS [UpdateServiceAccessPoliciesResponse]
$creadList :: ReadS [UpdateServiceAccessPoliciesResponse]
readsPrec :: Int -> ReadS UpdateServiceAccessPoliciesResponse
$creadsPrec :: Int -> ReadS UpdateServiceAccessPoliciesResponse
Prelude.Read, Int -> UpdateServiceAccessPoliciesResponse -> ShowS
[UpdateServiceAccessPoliciesResponse] -> ShowS
UpdateServiceAccessPoliciesResponse -> String
(Int -> UpdateServiceAccessPoliciesResponse -> ShowS)
-> (UpdateServiceAccessPoliciesResponse -> String)
-> ([UpdateServiceAccessPoliciesResponse] -> ShowS)
-> Show UpdateServiceAccessPoliciesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceAccessPoliciesResponse] -> ShowS
$cshowList :: [UpdateServiceAccessPoliciesResponse] -> ShowS
show :: UpdateServiceAccessPoliciesResponse -> String
$cshow :: UpdateServiceAccessPoliciesResponse -> String
showsPrec :: Int -> UpdateServiceAccessPoliciesResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceAccessPoliciesResponse -> ShowS
Prelude.Show, (forall x.
UpdateServiceAccessPoliciesResponse
-> Rep UpdateServiceAccessPoliciesResponse x)
-> (forall x.
Rep UpdateServiceAccessPoliciesResponse x
-> UpdateServiceAccessPoliciesResponse)
-> Generic UpdateServiceAccessPoliciesResponse
forall x.
Rep UpdateServiceAccessPoliciesResponse x
-> UpdateServiceAccessPoliciesResponse
forall x.
UpdateServiceAccessPoliciesResponse
-> Rep UpdateServiceAccessPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceAccessPoliciesResponse x
-> UpdateServiceAccessPoliciesResponse
$cfrom :: forall x.
UpdateServiceAccessPoliciesResponse
-> Rep UpdateServiceAccessPoliciesResponse x
Prelude.Generic)
newUpdateServiceAccessPoliciesResponse ::
Prelude.Int ->
AccessPoliciesStatus ->
UpdateServiceAccessPoliciesResponse
newUpdateServiceAccessPoliciesResponse :: Int -> AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse
newUpdateServiceAccessPoliciesResponse
Int
pHttpStatus_
AccessPoliciesStatus
pAccessPolicies_ =
UpdateServiceAccessPoliciesResponse' :: Int -> AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse
UpdateServiceAccessPoliciesResponse'
{ $sel:httpStatus:UpdateServiceAccessPoliciesResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:accessPolicies:UpdateServiceAccessPoliciesResponse' :: AccessPoliciesStatus
accessPolicies = AccessPoliciesStatus
pAccessPolicies_
}
updateServiceAccessPoliciesResponse_httpStatus :: Lens.Lens' UpdateServiceAccessPoliciesResponse Prelude.Int
updateServiceAccessPoliciesResponse_httpStatus :: (Int -> f Int)
-> UpdateServiceAccessPoliciesResponse
-> f UpdateServiceAccessPoliciesResponse
updateServiceAccessPoliciesResponse_httpStatus = (UpdateServiceAccessPoliciesResponse -> Int)
-> (UpdateServiceAccessPoliciesResponse
-> Int -> UpdateServiceAccessPoliciesResponse)
-> Lens
UpdateServiceAccessPoliciesResponse
UpdateServiceAccessPoliciesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceAccessPoliciesResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServiceAccessPoliciesResponse' :: UpdateServiceAccessPoliciesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServiceAccessPoliciesResponse
s@UpdateServiceAccessPoliciesResponse' {} Int
a -> UpdateServiceAccessPoliciesResponse
s {$sel:httpStatus:UpdateServiceAccessPoliciesResponse' :: Int
httpStatus = Int
a} :: UpdateServiceAccessPoliciesResponse)
updateServiceAccessPoliciesResponse_accessPolicies :: Lens.Lens' UpdateServiceAccessPoliciesResponse AccessPoliciesStatus
updateServiceAccessPoliciesResponse_accessPolicies :: (AccessPoliciesStatus -> f AccessPoliciesStatus)
-> UpdateServiceAccessPoliciesResponse
-> f UpdateServiceAccessPoliciesResponse
updateServiceAccessPoliciesResponse_accessPolicies = (UpdateServiceAccessPoliciesResponse -> AccessPoliciesStatus)
-> (UpdateServiceAccessPoliciesResponse
-> AccessPoliciesStatus -> UpdateServiceAccessPoliciesResponse)
-> Lens
UpdateServiceAccessPoliciesResponse
UpdateServiceAccessPoliciesResponse
AccessPoliciesStatus
AccessPoliciesStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceAccessPoliciesResponse' {AccessPoliciesStatus
accessPolicies :: AccessPoliciesStatus
$sel:accessPolicies:UpdateServiceAccessPoliciesResponse' :: UpdateServiceAccessPoliciesResponse -> AccessPoliciesStatus
accessPolicies} -> AccessPoliciesStatus
accessPolicies) (\s :: UpdateServiceAccessPoliciesResponse
s@UpdateServiceAccessPoliciesResponse' {} AccessPoliciesStatus
a -> UpdateServiceAccessPoliciesResponse
s {$sel:accessPolicies:UpdateServiceAccessPoliciesResponse' :: AccessPoliciesStatus
accessPolicies = AccessPoliciesStatus
a} :: UpdateServiceAccessPoliciesResponse)
instance
Prelude.NFData
UpdateServiceAccessPoliciesResponse