{-# 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.SQS.AddPermission
(
AddPermission (..),
newAddPermission,
addPermission_queueUrl,
addPermission_label,
addPermission_aWSAccountIds,
addPermission_actions,
AddPermissionResponse (..),
newAddPermissionResponse,
)
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.SQS.Types
data AddPermission = AddPermission'
{
AddPermission -> Text
queueUrl :: Prelude.Text,
AddPermission -> Text
label :: Prelude.Text,
AddPermission -> [Text]
aWSAccountIds :: [Prelude.Text],
AddPermission -> [Text]
actions :: [Prelude.Text]
}
deriving (AddPermission -> AddPermission -> Bool
(AddPermission -> AddPermission -> Bool)
-> (AddPermission -> AddPermission -> Bool) -> Eq AddPermission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddPermission -> AddPermission -> Bool
$c/= :: AddPermission -> AddPermission -> Bool
== :: AddPermission -> AddPermission -> Bool
$c== :: AddPermission -> AddPermission -> Bool
Prelude.Eq, ReadPrec [AddPermission]
ReadPrec AddPermission
Int -> ReadS AddPermission
ReadS [AddPermission]
(Int -> ReadS AddPermission)
-> ReadS [AddPermission]
-> ReadPrec AddPermission
-> ReadPrec [AddPermission]
-> Read AddPermission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddPermission]
$creadListPrec :: ReadPrec [AddPermission]
readPrec :: ReadPrec AddPermission
$creadPrec :: ReadPrec AddPermission
readList :: ReadS [AddPermission]
$creadList :: ReadS [AddPermission]
readsPrec :: Int -> ReadS AddPermission
$creadsPrec :: Int -> ReadS AddPermission
Prelude.Read, Int -> AddPermission -> ShowS
[AddPermission] -> ShowS
AddPermission -> String
(Int -> AddPermission -> ShowS)
-> (AddPermission -> String)
-> ([AddPermission] -> ShowS)
-> Show AddPermission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddPermission] -> ShowS
$cshowList :: [AddPermission] -> ShowS
show :: AddPermission -> String
$cshow :: AddPermission -> String
showsPrec :: Int -> AddPermission -> ShowS
$cshowsPrec :: Int -> AddPermission -> ShowS
Prelude.Show, (forall x. AddPermission -> Rep AddPermission x)
-> (forall x. Rep AddPermission x -> AddPermission)
-> Generic AddPermission
forall x. Rep AddPermission x -> AddPermission
forall x. AddPermission -> Rep AddPermission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddPermission x -> AddPermission
$cfrom :: forall x. AddPermission -> Rep AddPermission x
Prelude.Generic)
newAddPermission ::
Prelude.Text ->
Prelude.Text ->
AddPermission
newAddPermission :: Text -> Text -> AddPermission
newAddPermission Text
pQueueUrl_ Text
pLabel_ =
AddPermission' :: Text -> Text -> [Text] -> [Text] -> AddPermission
AddPermission'
{ $sel:queueUrl:AddPermission' :: Text
queueUrl = Text
pQueueUrl_,
$sel:label:AddPermission' :: Text
label = Text
pLabel_,
$sel:aWSAccountIds:AddPermission' :: [Text]
aWSAccountIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:actions:AddPermission' :: [Text]
actions = [Text]
forall a. Monoid a => a
Prelude.mempty
}
addPermission_queueUrl :: Lens.Lens' AddPermission Prelude.Text
addPermission_queueUrl :: (Text -> f Text) -> AddPermission -> f AddPermission
addPermission_queueUrl = (AddPermission -> Text)
-> (AddPermission -> Text -> AddPermission)
-> Lens AddPermission AddPermission Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPermission' {Text
queueUrl :: Text
$sel:queueUrl:AddPermission' :: AddPermission -> Text
queueUrl} -> Text
queueUrl) (\s :: AddPermission
s@AddPermission' {} Text
a -> AddPermission
s {$sel:queueUrl:AddPermission' :: Text
queueUrl = Text
a} :: AddPermission)
addPermission_label :: Lens.Lens' AddPermission Prelude.Text
addPermission_label :: (Text -> f Text) -> AddPermission -> f AddPermission
addPermission_label = (AddPermission -> Text)
-> (AddPermission -> Text -> AddPermission)
-> Lens AddPermission AddPermission Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPermission' {Text
label :: Text
$sel:label:AddPermission' :: AddPermission -> Text
label} -> Text
label) (\s :: AddPermission
s@AddPermission' {} Text
a -> AddPermission
s {$sel:label:AddPermission' :: Text
label = Text
a} :: AddPermission)
addPermission_aWSAccountIds :: Lens.Lens' AddPermission [Prelude.Text]
addPermission_aWSAccountIds :: ([Text] -> f [Text]) -> AddPermission -> f AddPermission
addPermission_aWSAccountIds = (AddPermission -> [Text])
-> (AddPermission -> [Text] -> AddPermission)
-> Lens AddPermission AddPermission [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPermission' {[Text]
aWSAccountIds :: [Text]
$sel:aWSAccountIds:AddPermission' :: AddPermission -> [Text]
aWSAccountIds} -> [Text]
aWSAccountIds) (\s :: AddPermission
s@AddPermission' {} [Text]
a -> AddPermission
s {$sel:aWSAccountIds:AddPermission' :: [Text]
aWSAccountIds = [Text]
a} :: AddPermission) (([Text] -> f [Text]) -> AddPermission -> f AddPermission)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> AddPermission
-> f AddPermission
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
addPermission_actions :: Lens.Lens' AddPermission [Prelude.Text]
addPermission_actions :: ([Text] -> f [Text]) -> AddPermission -> f AddPermission
addPermission_actions = (AddPermission -> [Text])
-> (AddPermission -> [Text] -> AddPermission)
-> Lens AddPermission AddPermission [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AddPermission' {[Text]
actions :: [Text]
$sel:actions:AddPermission' :: AddPermission -> [Text]
actions} -> [Text]
actions) (\s :: AddPermission
s@AddPermission' {} [Text]
a -> AddPermission
s {$sel:actions:AddPermission' :: [Text]
actions = [Text]
a} :: AddPermission) (([Text] -> f [Text]) -> AddPermission -> f AddPermission)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> AddPermission
-> f AddPermission
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest AddPermission where
type
AWSResponse AddPermission =
AddPermissionResponse
request :: AddPermission -> Request AddPermission
request = Service -> AddPermission -> Request AddPermission
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy AddPermission
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddPermission)))
response =
AWSResponse AddPermission
-> Logger
-> Service
-> Proxy AddPermission
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AddPermission)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AddPermission
AddPermissionResponse
AddPermissionResponse'
instance Prelude.Hashable AddPermission
instance Prelude.NFData AddPermission
instance Core.ToHeaders AddPermission where
toHeaders :: AddPermission -> [Header]
toHeaders = [Header] -> AddPermission -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath AddPermission where
toPath :: AddPermission -> ByteString
toPath = ByteString -> AddPermission -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AddPermission where
toQuery :: AddPermission -> QueryString
toQuery AddPermission' {[Text]
Text
actions :: [Text]
aWSAccountIds :: [Text]
label :: Text
queueUrl :: Text
$sel:actions:AddPermission' :: AddPermission -> [Text]
$sel:aWSAccountIds:AddPermission' :: AddPermission -> [Text]
$sel:label:AddPermission' :: AddPermission -> Text
$sel:queueUrl:AddPermission' :: AddPermission -> 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
"AddPermission" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-11-05" :: Prelude.ByteString),
ByteString
"QueueUrl" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
queueUrl,
ByteString
"Label" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
label,
ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"AWSAccountId" [Text]
aWSAccountIds,
ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"ActionName" [Text]
actions
]
data AddPermissionResponse = AddPermissionResponse'
{
}
deriving (AddPermissionResponse -> AddPermissionResponse -> Bool
(AddPermissionResponse -> AddPermissionResponse -> Bool)
-> (AddPermissionResponse -> AddPermissionResponse -> Bool)
-> Eq AddPermissionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AddPermissionResponse -> AddPermissionResponse -> Bool
$c/= :: AddPermissionResponse -> AddPermissionResponse -> Bool
== :: AddPermissionResponse -> AddPermissionResponse -> Bool
$c== :: AddPermissionResponse -> AddPermissionResponse -> Bool
Prelude.Eq, ReadPrec [AddPermissionResponse]
ReadPrec AddPermissionResponse
Int -> ReadS AddPermissionResponse
ReadS [AddPermissionResponse]
(Int -> ReadS AddPermissionResponse)
-> ReadS [AddPermissionResponse]
-> ReadPrec AddPermissionResponse
-> ReadPrec [AddPermissionResponse]
-> Read AddPermissionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AddPermissionResponse]
$creadListPrec :: ReadPrec [AddPermissionResponse]
readPrec :: ReadPrec AddPermissionResponse
$creadPrec :: ReadPrec AddPermissionResponse
readList :: ReadS [AddPermissionResponse]
$creadList :: ReadS [AddPermissionResponse]
readsPrec :: Int -> ReadS AddPermissionResponse
$creadsPrec :: Int -> ReadS AddPermissionResponse
Prelude.Read, Int -> AddPermissionResponse -> ShowS
[AddPermissionResponse] -> ShowS
AddPermissionResponse -> String
(Int -> AddPermissionResponse -> ShowS)
-> (AddPermissionResponse -> String)
-> ([AddPermissionResponse] -> ShowS)
-> Show AddPermissionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AddPermissionResponse] -> ShowS
$cshowList :: [AddPermissionResponse] -> ShowS
show :: AddPermissionResponse -> String
$cshow :: AddPermissionResponse -> String
showsPrec :: Int -> AddPermissionResponse -> ShowS
$cshowsPrec :: Int -> AddPermissionResponse -> ShowS
Prelude.Show, (forall x. AddPermissionResponse -> Rep AddPermissionResponse x)
-> (forall x. Rep AddPermissionResponse x -> AddPermissionResponse)
-> Generic AddPermissionResponse
forall x. Rep AddPermissionResponse x -> AddPermissionResponse
forall x. AddPermissionResponse -> Rep AddPermissionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AddPermissionResponse x -> AddPermissionResponse
$cfrom :: forall x. AddPermissionResponse -> Rep AddPermissionResponse x
Prelude.Generic)
newAddPermissionResponse ::
AddPermissionResponse
newAddPermissionResponse :: AddPermissionResponse
newAddPermissionResponse = AddPermissionResponse
AddPermissionResponse'
instance Prelude.NFData AddPermissionResponse