{-# 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.Connect.UpdateUserSecurityProfiles
(
UpdateUserSecurityProfiles (..),
newUpdateUserSecurityProfiles,
updateUserSecurityProfiles_securityProfileIds,
updateUserSecurityProfiles_userId,
updateUserSecurityProfiles_instanceId,
UpdateUserSecurityProfilesResponse (..),
newUpdateUserSecurityProfilesResponse,
)
where
import Amazonka.Connect.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 UpdateUserSecurityProfiles = UpdateUserSecurityProfiles'
{
UpdateUserSecurityProfiles -> NonEmpty Text
securityProfileIds :: Prelude.NonEmpty Prelude.Text,
UpdateUserSecurityProfiles -> Text
userId :: Prelude.Text,
UpdateUserSecurityProfiles -> Text
instanceId :: Prelude.Text
}
deriving (UpdateUserSecurityProfiles -> UpdateUserSecurityProfiles -> Bool
(UpdateUserSecurityProfiles -> UpdateUserSecurityProfiles -> Bool)
-> (UpdateUserSecurityProfiles
-> UpdateUserSecurityProfiles -> Bool)
-> Eq UpdateUserSecurityProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserSecurityProfiles -> UpdateUserSecurityProfiles -> Bool
$c/= :: UpdateUserSecurityProfiles -> UpdateUserSecurityProfiles -> Bool
== :: UpdateUserSecurityProfiles -> UpdateUserSecurityProfiles -> Bool
$c== :: UpdateUserSecurityProfiles -> UpdateUserSecurityProfiles -> Bool
Prelude.Eq, ReadPrec [UpdateUserSecurityProfiles]
ReadPrec UpdateUserSecurityProfiles
Int -> ReadS UpdateUserSecurityProfiles
ReadS [UpdateUserSecurityProfiles]
(Int -> ReadS UpdateUserSecurityProfiles)
-> ReadS [UpdateUserSecurityProfiles]
-> ReadPrec UpdateUserSecurityProfiles
-> ReadPrec [UpdateUserSecurityProfiles]
-> Read UpdateUserSecurityProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserSecurityProfiles]
$creadListPrec :: ReadPrec [UpdateUserSecurityProfiles]
readPrec :: ReadPrec UpdateUserSecurityProfiles
$creadPrec :: ReadPrec UpdateUserSecurityProfiles
readList :: ReadS [UpdateUserSecurityProfiles]
$creadList :: ReadS [UpdateUserSecurityProfiles]
readsPrec :: Int -> ReadS UpdateUserSecurityProfiles
$creadsPrec :: Int -> ReadS UpdateUserSecurityProfiles
Prelude.Read, Int -> UpdateUserSecurityProfiles -> ShowS
[UpdateUserSecurityProfiles] -> ShowS
UpdateUserSecurityProfiles -> String
(Int -> UpdateUserSecurityProfiles -> ShowS)
-> (UpdateUserSecurityProfiles -> String)
-> ([UpdateUserSecurityProfiles] -> ShowS)
-> Show UpdateUserSecurityProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserSecurityProfiles] -> ShowS
$cshowList :: [UpdateUserSecurityProfiles] -> ShowS
show :: UpdateUserSecurityProfiles -> String
$cshow :: UpdateUserSecurityProfiles -> String
showsPrec :: Int -> UpdateUserSecurityProfiles -> ShowS
$cshowsPrec :: Int -> UpdateUserSecurityProfiles -> ShowS
Prelude.Show, (forall x.
UpdateUserSecurityProfiles -> Rep UpdateUserSecurityProfiles x)
-> (forall x.
Rep UpdateUserSecurityProfiles x -> UpdateUserSecurityProfiles)
-> Generic UpdateUserSecurityProfiles
forall x.
Rep UpdateUserSecurityProfiles x -> UpdateUserSecurityProfiles
forall x.
UpdateUserSecurityProfiles -> Rep UpdateUserSecurityProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserSecurityProfiles x -> UpdateUserSecurityProfiles
$cfrom :: forall x.
UpdateUserSecurityProfiles -> Rep UpdateUserSecurityProfiles x
Prelude.Generic)
newUpdateUserSecurityProfiles ::
Prelude.NonEmpty Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
UpdateUserSecurityProfiles
newUpdateUserSecurityProfiles :: NonEmpty Text -> Text -> Text -> UpdateUserSecurityProfiles
newUpdateUserSecurityProfiles
NonEmpty Text
pSecurityProfileIds_
Text
pUserId_
Text
pInstanceId_ =
UpdateUserSecurityProfiles' :: NonEmpty Text -> Text -> Text -> UpdateUserSecurityProfiles
UpdateUserSecurityProfiles'
{ $sel:securityProfileIds:UpdateUserSecurityProfiles' :: NonEmpty Text
securityProfileIds =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSecurityProfileIds_,
$sel:userId:UpdateUserSecurityProfiles' :: Text
userId = Text
pUserId_,
$sel:instanceId:UpdateUserSecurityProfiles' :: Text
instanceId = Text
pInstanceId_
}
updateUserSecurityProfiles_securityProfileIds :: Lens.Lens' UpdateUserSecurityProfiles (Prelude.NonEmpty Prelude.Text)
updateUserSecurityProfiles_securityProfileIds :: (NonEmpty Text -> f (NonEmpty Text))
-> UpdateUserSecurityProfiles -> f UpdateUserSecurityProfiles
updateUserSecurityProfiles_securityProfileIds = (UpdateUserSecurityProfiles -> NonEmpty Text)
-> (UpdateUserSecurityProfiles
-> NonEmpty Text -> UpdateUserSecurityProfiles)
-> Lens
UpdateUserSecurityProfiles
UpdateUserSecurityProfiles
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserSecurityProfiles' {NonEmpty Text
securityProfileIds :: NonEmpty Text
$sel:securityProfileIds:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> NonEmpty Text
securityProfileIds} -> NonEmpty Text
securityProfileIds) (\s :: UpdateUserSecurityProfiles
s@UpdateUserSecurityProfiles' {} NonEmpty Text
a -> UpdateUserSecurityProfiles
s {$sel:securityProfileIds:UpdateUserSecurityProfiles' :: NonEmpty Text
securityProfileIds = NonEmpty Text
a} :: UpdateUserSecurityProfiles) ((NonEmpty Text -> f (NonEmpty Text))
-> UpdateUserSecurityProfiles -> f UpdateUserSecurityProfiles)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> UpdateUserSecurityProfiles
-> f UpdateUserSecurityProfiles
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateUserSecurityProfiles_userId :: Lens.Lens' UpdateUserSecurityProfiles Prelude.Text
updateUserSecurityProfiles_userId :: (Text -> f Text)
-> UpdateUserSecurityProfiles -> f UpdateUserSecurityProfiles
updateUserSecurityProfiles_userId = (UpdateUserSecurityProfiles -> Text)
-> (UpdateUserSecurityProfiles
-> Text -> UpdateUserSecurityProfiles)
-> Lens
UpdateUserSecurityProfiles UpdateUserSecurityProfiles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserSecurityProfiles' {Text
userId :: Text
$sel:userId:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> Text
userId} -> Text
userId) (\s :: UpdateUserSecurityProfiles
s@UpdateUserSecurityProfiles' {} Text
a -> UpdateUserSecurityProfiles
s {$sel:userId:UpdateUserSecurityProfiles' :: Text
userId = Text
a} :: UpdateUserSecurityProfiles)
updateUserSecurityProfiles_instanceId :: Lens.Lens' UpdateUserSecurityProfiles Prelude.Text
updateUserSecurityProfiles_instanceId :: (Text -> f Text)
-> UpdateUserSecurityProfiles -> f UpdateUserSecurityProfiles
updateUserSecurityProfiles_instanceId = (UpdateUserSecurityProfiles -> Text)
-> (UpdateUserSecurityProfiles
-> Text -> UpdateUserSecurityProfiles)
-> Lens
UpdateUserSecurityProfiles UpdateUserSecurityProfiles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserSecurityProfiles' {Text
instanceId :: Text
$sel:instanceId:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> Text
instanceId} -> Text
instanceId) (\s :: UpdateUserSecurityProfiles
s@UpdateUserSecurityProfiles' {} Text
a -> UpdateUserSecurityProfiles
s {$sel:instanceId:UpdateUserSecurityProfiles' :: Text
instanceId = Text
a} :: UpdateUserSecurityProfiles)
instance Core.AWSRequest UpdateUserSecurityProfiles where
type
AWSResponse UpdateUserSecurityProfiles =
UpdateUserSecurityProfilesResponse
request :: UpdateUserSecurityProfiles -> Request UpdateUserSecurityProfiles
request = Service
-> UpdateUserSecurityProfiles -> Request UpdateUserSecurityProfiles
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateUserSecurityProfiles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserSecurityProfiles)))
response =
AWSResponse UpdateUserSecurityProfiles
-> Logger
-> Service
-> Proxy UpdateUserSecurityProfiles
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserSecurityProfiles)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse UpdateUserSecurityProfiles
UpdateUserSecurityProfilesResponse
UpdateUserSecurityProfilesResponse'
instance Prelude.Hashable UpdateUserSecurityProfiles
instance Prelude.NFData UpdateUserSecurityProfiles
instance Core.ToHeaders UpdateUserSecurityProfiles where
toHeaders :: UpdateUserSecurityProfiles -> [Header]
toHeaders =
[Header] -> UpdateUserSecurityProfiles -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateUserSecurityProfiles where
toJSON :: UpdateUserSecurityProfiles -> Value
toJSON UpdateUserSecurityProfiles' {NonEmpty Text
Text
instanceId :: Text
userId :: Text
securityProfileIds :: NonEmpty Text
$sel:instanceId:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> Text
$sel:userId:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> Text
$sel:securityProfileIds:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> NonEmpty Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"SecurityProfileIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
securityProfileIds)
]
)
instance Core.ToPath UpdateUserSecurityProfiles where
toPath :: UpdateUserSecurityProfiles -> ByteString
toPath UpdateUserSecurityProfiles' {NonEmpty Text
Text
instanceId :: Text
userId :: Text
securityProfileIds :: NonEmpty Text
$sel:instanceId:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> Text
$sel:userId:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> Text
$sel:securityProfileIds:UpdateUserSecurityProfiles' :: UpdateUserSecurityProfiles -> NonEmpty Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/users/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
userId,
ByteString
"/security-profiles"
]
instance Core.ToQuery UpdateUserSecurityProfiles where
toQuery :: UpdateUserSecurityProfiles -> QueryString
toQuery = QueryString -> UpdateUserSecurityProfiles -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateUserSecurityProfilesResponse = UpdateUserSecurityProfilesResponse'
{
}
deriving (UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool
(UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool)
-> (UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool)
-> Eq UpdateUserSecurityProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool
$c/= :: UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool
== :: UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool
$c== :: UpdateUserSecurityProfilesResponse
-> UpdateUserSecurityProfilesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateUserSecurityProfilesResponse]
ReadPrec UpdateUserSecurityProfilesResponse
Int -> ReadS UpdateUserSecurityProfilesResponse
ReadS [UpdateUserSecurityProfilesResponse]
(Int -> ReadS UpdateUserSecurityProfilesResponse)
-> ReadS [UpdateUserSecurityProfilesResponse]
-> ReadPrec UpdateUserSecurityProfilesResponse
-> ReadPrec [UpdateUserSecurityProfilesResponse]
-> Read UpdateUserSecurityProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserSecurityProfilesResponse]
$creadListPrec :: ReadPrec [UpdateUserSecurityProfilesResponse]
readPrec :: ReadPrec UpdateUserSecurityProfilesResponse
$creadPrec :: ReadPrec UpdateUserSecurityProfilesResponse
readList :: ReadS [UpdateUserSecurityProfilesResponse]
$creadList :: ReadS [UpdateUserSecurityProfilesResponse]
readsPrec :: Int -> ReadS UpdateUserSecurityProfilesResponse
$creadsPrec :: Int -> ReadS UpdateUserSecurityProfilesResponse
Prelude.Read, Int -> UpdateUserSecurityProfilesResponse -> ShowS
[UpdateUserSecurityProfilesResponse] -> ShowS
UpdateUserSecurityProfilesResponse -> String
(Int -> UpdateUserSecurityProfilesResponse -> ShowS)
-> (UpdateUserSecurityProfilesResponse -> String)
-> ([UpdateUserSecurityProfilesResponse] -> ShowS)
-> Show UpdateUserSecurityProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserSecurityProfilesResponse] -> ShowS
$cshowList :: [UpdateUserSecurityProfilesResponse] -> ShowS
show :: UpdateUserSecurityProfilesResponse -> String
$cshow :: UpdateUserSecurityProfilesResponse -> String
showsPrec :: Int -> UpdateUserSecurityProfilesResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserSecurityProfilesResponse -> ShowS
Prelude.Show, (forall x.
UpdateUserSecurityProfilesResponse
-> Rep UpdateUserSecurityProfilesResponse x)
-> (forall x.
Rep UpdateUserSecurityProfilesResponse x
-> UpdateUserSecurityProfilesResponse)
-> Generic UpdateUserSecurityProfilesResponse
forall x.
Rep UpdateUserSecurityProfilesResponse x
-> UpdateUserSecurityProfilesResponse
forall x.
UpdateUserSecurityProfilesResponse
-> Rep UpdateUserSecurityProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserSecurityProfilesResponse x
-> UpdateUserSecurityProfilesResponse
$cfrom :: forall x.
UpdateUserSecurityProfilesResponse
-> Rep UpdateUserSecurityProfilesResponse x
Prelude.Generic)
newUpdateUserSecurityProfilesResponse ::
UpdateUserSecurityProfilesResponse
newUpdateUserSecurityProfilesResponse :: UpdateUserSecurityProfilesResponse
newUpdateUserSecurityProfilesResponse =
UpdateUserSecurityProfilesResponse
UpdateUserSecurityProfilesResponse'
instance
Prelude.NFData
UpdateUserSecurityProfilesResponse