{-# 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.UpdateTrafficDistribution
(
UpdateTrafficDistribution (..),
newUpdateTrafficDistribution,
updateTrafficDistribution_telephonyConfig,
updateTrafficDistribution_id,
UpdateTrafficDistributionResponse (..),
newUpdateTrafficDistributionResponse,
updateTrafficDistributionResponse_httpStatus,
)
where
import Amazonka.Connect.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateTrafficDistribution = UpdateTrafficDistribution'
{
UpdateTrafficDistribution -> Maybe TelephonyConfig
telephonyConfig :: Prelude.Maybe TelephonyConfig,
UpdateTrafficDistribution -> Text
id :: Prelude.Text
}
deriving (UpdateTrafficDistribution -> UpdateTrafficDistribution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTrafficDistribution -> UpdateTrafficDistribution -> Bool
$c/= :: UpdateTrafficDistribution -> UpdateTrafficDistribution -> Bool
== :: UpdateTrafficDistribution -> UpdateTrafficDistribution -> Bool
$c== :: UpdateTrafficDistribution -> UpdateTrafficDistribution -> Bool
Prelude.Eq, ReadPrec [UpdateTrafficDistribution]
ReadPrec UpdateTrafficDistribution
Int -> ReadS UpdateTrafficDistribution
ReadS [UpdateTrafficDistribution]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTrafficDistribution]
$creadListPrec :: ReadPrec [UpdateTrafficDistribution]
readPrec :: ReadPrec UpdateTrafficDistribution
$creadPrec :: ReadPrec UpdateTrafficDistribution
readList :: ReadS [UpdateTrafficDistribution]
$creadList :: ReadS [UpdateTrafficDistribution]
readsPrec :: Int -> ReadS UpdateTrafficDistribution
$creadsPrec :: Int -> ReadS UpdateTrafficDistribution
Prelude.Read, Int -> UpdateTrafficDistribution -> ShowS
[UpdateTrafficDistribution] -> ShowS
UpdateTrafficDistribution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTrafficDistribution] -> ShowS
$cshowList :: [UpdateTrafficDistribution] -> ShowS
show :: UpdateTrafficDistribution -> String
$cshow :: UpdateTrafficDistribution -> String
showsPrec :: Int -> UpdateTrafficDistribution -> ShowS
$cshowsPrec :: Int -> UpdateTrafficDistribution -> ShowS
Prelude.Show, forall x.
Rep UpdateTrafficDistribution x -> UpdateTrafficDistribution
forall x.
UpdateTrafficDistribution -> Rep UpdateTrafficDistribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTrafficDistribution x -> UpdateTrafficDistribution
$cfrom :: forall x.
UpdateTrafficDistribution -> Rep UpdateTrafficDistribution x
Prelude.Generic)
newUpdateTrafficDistribution ::
Prelude.Text ->
UpdateTrafficDistribution
newUpdateTrafficDistribution :: Text -> UpdateTrafficDistribution
newUpdateTrafficDistribution Text
pId_ =
UpdateTrafficDistribution'
{ $sel:telephonyConfig:UpdateTrafficDistribution' :: Maybe TelephonyConfig
telephonyConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:id:UpdateTrafficDistribution' :: Text
id = Text
pId_
}
updateTrafficDistribution_telephonyConfig :: Lens.Lens' UpdateTrafficDistribution (Prelude.Maybe TelephonyConfig)
updateTrafficDistribution_telephonyConfig :: Lens' UpdateTrafficDistribution (Maybe TelephonyConfig)
updateTrafficDistribution_telephonyConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficDistribution' {Maybe TelephonyConfig
telephonyConfig :: Maybe TelephonyConfig
$sel:telephonyConfig:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Maybe TelephonyConfig
telephonyConfig} -> Maybe TelephonyConfig
telephonyConfig) (\s :: UpdateTrafficDistribution
s@UpdateTrafficDistribution' {} Maybe TelephonyConfig
a -> UpdateTrafficDistribution
s {$sel:telephonyConfig:UpdateTrafficDistribution' :: Maybe TelephonyConfig
telephonyConfig = Maybe TelephonyConfig
a} :: UpdateTrafficDistribution)
updateTrafficDistribution_id :: Lens.Lens' UpdateTrafficDistribution Prelude.Text
updateTrafficDistribution_id :: Lens' UpdateTrafficDistribution Text
updateTrafficDistribution_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficDistribution' {Text
id :: Text
$sel:id:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Text
id} -> Text
id) (\s :: UpdateTrafficDistribution
s@UpdateTrafficDistribution' {} Text
a -> UpdateTrafficDistribution
s {$sel:id:UpdateTrafficDistribution' :: Text
id = Text
a} :: UpdateTrafficDistribution)
instance Core.AWSRequest UpdateTrafficDistribution where
type
AWSResponse UpdateTrafficDistribution =
UpdateTrafficDistributionResponse
request :: (Service -> Service)
-> UpdateTrafficDistribution -> Request UpdateTrafficDistribution
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 UpdateTrafficDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateTrafficDistribution)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateTrafficDistributionResponse
UpdateTrafficDistributionResponse'
forall (f :: * -> *) a b. Functor 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 UpdateTrafficDistribution where
hashWithSalt :: Int -> UpdateTrafficDistribution -> Int
hashWithSalt Int
_salt UpdateTrafficDistribution' {Maybe TelephonyConfig
Text
id :: Text
telephonyConfig :: Maybe TelephonyConfig
$sel:id:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Text
$sel:telephonyConfig:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Maybe TelephonyConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TelephonyConfig
telephonyConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData UpdateTrafficDistribution where
rnf :: UpdateTrafficDistribution -> ()
rnf UpdateTrafficDistribution' {Maybe TelephonyConfig
Text
id :: Text
telephonyConfig :: Maybe TelephonyConfig
$sel:id:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Text
$sel:telephonyConfig:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Maybe TelephonyConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe TelephonyConfig
telephonyConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders UpdateTrafficDistribution where
toHeaders :: UpdateTrafficDistribution -> 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.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateTrafficDistribution where
toJSON :: UpdateTrafficDistribution -> Value
toJSON UpdateTrafficDistribution' {Maybe TelephonyConfig
Text
id :: Text
telephonyConfig :: Maybe TelephonyConfig
$sel:id:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Text
$sel:telephonyConfig:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Maybe TelephonyConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"TelephonyConfig" 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 TelephonyConfig
telephonyConfig
]
)
instance Data.ToPath UpdateTrafficDistribution where
toPath :: UpdateTrafficDistribution -> ByteString
toPath UpdateTrafficDistribution' {Maybe TelephonyConfig
Text
id :: Text
telephonyConfig :: Maybe TelephonyConfig
$sel:id:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Text
$sel:telephonyConfig:UpdateTrafficDistribution' :: UpdateTrafficDistribution -> Maybe TelephonyConfig
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/traffic-distribution/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]
instance Data.ToQuery UpdateTrafficDistribution where
toQuery :: UpdateTrafficDistribution -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateTrafficDistributionResponse = UpdateTrafficDistributionResponse'
{
UpdateTrafficDistributionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateTrafficDistributionResponse
-> UpdateTrafficDistributionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTrafficDistributionResponse
-> UpdateTrafficDistributionResponse -> Bool
$c/= :: UpdateTrafficDistributionResponse
-> UpdateTrafficDistributionResponse -> Bool
== :: UpdateTrafficDistributionResponse
-> UpdateTrafficDistributionResponse -> Bool
$c== :: UpdateTrafficDistributionResponse
-> UpdateTrafficDistributionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTrafficDistributionResponse]
ReadPrec UpdateTrafficDistributionResponse
Int -> ReadS UpdateTrafficDistributionResponse
ReadS [UpdateTrafficDistributionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTrafficDistributionResponse]
$creadListPrec :: ReadPrec [UpdateTrafficDistributionResponse]
readPrec :: ReadPrec UpdateTrafficDistributionResponse
$creadPrec :: ReadPrec UpdateTrafficDistributionResponse
readList :: ReadS [UpdateTrafficDistributionResponse]
$creadList :: ReadS [UpdateTrafficDistributionResponse]
readsPrec :: Int -> ReadS UpdateTrafficDistributionResponse
$creadsPrec :: Int -> ReadS UpdateTrafficDistributionResponse
Prelude.Read, Int -> UpdateTrafficDistributionResponse -> ShowS
[UpdateTrafficDistributionResponse] -> ShowS
UpdateTrafficDistributionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTrafficDistributionResponse] -> ShowS
$cshowList :: [UpdateTrafficDistributionResponse] -> ShowS
show :: UpdateTrafficDistributionResponse -> String
$cshow :: UpdateTrafficDistributionResponse -> String
showsPrec :: Int -> UpdateTrafficDistributionResponse -> ShowS
$cshowsPrec :: Int -> UpdateTrafficDistributionResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateTrafficDistributionResponse x
-> UpdateTrafficDistributionResponse
forall x.
UpdateTrafficDistributionResponse
-> Rep UpdateTrafficDistributionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTrafficDistributionResponse x
-> UpdateTrafficDistributionResponse
$cfrom :: forall x.
UpdateTrafficDistributionResponse
-> Rep UpdateTrafficDistributionResponse x
Prelude.Generic)
newUpdateTrafficDistributionResponse ::
Prelude.Int ->
UpdateTrafficDistributionResponse
newUpdateTrafficDistributionResponse :: Int -> UpdateTrafficDistributionResponse
newUpdateTrafficDistributionResponse Int
pHttpStatus_ =
UpdateTrafficDistributionResponse'
{ $sel:httpStatus:UpdateTrafficDistributionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateTrafficDistributionResponse_httpStatus :: Lens.Lens' UpdateTrafficDistributionResponse Prelude.Int
updateTrafficDistributionResponse_httpStatus :: Lens' UpdateTrafficDistributionResponse Int
updateTrafficDistributionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficDistributionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTrafficDistributionResponse' :: UpdateTrafficDistributionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateTrafficDistributionResponse
s@UpdateTrafficDistributionResponse' {} Int
a -> UpdateTrafficDistributionResponse
s {$sel:httpStatus:UpdateTrafficDistributionResponse' :: Int
httpStatus = Int
a} :: UpdateTrafficDistributionResponse)
instance
Prelude.NFData
UpdateTrafficDistributionResponse
where
rnf :: UpdateTrafficDistributionResponse -> ()
rnf UpdateTrafficDistributionResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateTrafficDistributionResponse' :: UpdateTrafficDistributionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus