{-# 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.AutoScaling.DetachTrafficSources
(
DetachTrafficSources (..),
newDetachTrafficSources,
detachTrafficSources_autoScalingGroupName,
detachTrafficSources_trafficSources,
DetachTrafficSourcesResponse (..),
newDetachTrafficSourcesResponse,
detachTrafficSourcesResponse_httpStatus,
)
where
import Amazonka.AutoScaling.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 DetachTrafficSources = DetachTrafficSources'
{
DetachTrafficSources -> Text
autoScalingGroupName :: Prelude.Text,
DetachTrafficSources -> [TrafficSourceIdentifier]
trafficSources :: [TrafficSourceIdentifier]
}
deriving (DetachTrafficSources -> DetachTrafficSources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachTrafficSources -> DetachTrafficSources -> Bool
$c/= :: DetachTrafficSources -> DetachTrafficSources -> Bool
== :: DetachTrafficSources -> DetachTrafficSources -> Bool
$c== :: DetachTrafficSources -> DetachTrafficSources -> Bool
Prelude.Eq, ReadPrec [DetachTrafficSources]
ReadPrec DetachTrafficSources
Int -> ReadS DetachTrafficSources
ReadS [DetachTrafficSources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachTrafficSources]
$creadListPrec :: ReadPrec [DetachTrafficSources]
readPrec :: ReadPrec DetachTrafficSources
$creadPrec :: ReadPrec DetachTrafficSources
readList :: ReadS [DetachTrafficSources]
$creadList :: ReadS [DetachTrafficSources]
readsPrec :: Int -> ReadS DetachTrafficSources
$creadsPrec :: Int -> ReadS DetachTrafficSources
Prelude.Read, Int -> DetachTrafficSources -> ShowS
[DetachTrafficSources] -> ShowS
DetachTrafficSources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachTrafficSources] -> ShowS
$cshowList :: [DetachTrafficSources] -> ShowS
show :: DetachTrafficSources -> String
$cshow :: DetachTrafficSources -> String
showsPrec :: Int -> DetachTrafficSources -> ShowS
$cshowsPrec :: Int -> DetachTrafficSources -> ShowS
Prelude.Show, forall x. Rep DetachTrafficSources x -> DetachTrafficSources
forall x. DetachTrafficSources -> Rep DetachTrafficSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DetachTrafficSources x -> DetachTrafficSources
$cfrom :: forall x. DetachTrafficSources -> Rep DetachTrafficSources x
Prelude.Generic)
newDetachTrafficSources ::
Prelude.Text ->
DetachTrafficSources
newDetachTrafficSources :: Text -> DetachTrafficSources
newDetachTrafficSources Text
pAutoScalingGroupName_ =
DetachTrafficSources'
{ $sel:autoScalingGroupName:DetachTrafficSources' :: Text
autoScalingGroupName =
Text
pAutoScalingGroupName_,
$sel:trafficSources:DetachTrafficSources' :: [TrafficSourceIdentifier]
trafficSources = forall a. Monoid a => a
Prelude.mempty
}
detachTrafficSources_autoScalingGroupName :: Lens.Lens' DetachTrafficSources Prelude.Text
detachTrafficSources_autoScalingGroupName :: Lens' DetachTrafficSources Text
detachTrafficSources_autoScalingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachTrafficSources' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:DetachTrafficSources' :: DetachTrafficSources -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: DetachTrafficSources
s@DetachTrafficSources' {} Text
a -> DetachTrafficSources
s {$sel:autoScalingGroupName:DetachTrafficSources' :: Text
autoScalingGroupName = Text
a} :: DetachTrafficSources)
detachTrafficSources_trafficSources :: Lens.Lens' DetachTrafficSources [TrafficSourceIdentifier]
detachTrafficSources_trafficSources :: Lens' DetachTrafficSources [TrafficSourceIdentifier]
detachTrafficSources_trafficSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachTrafficSources' {[TrafficSourceIdentifier]
trafficSources :: [TrafficSourceIdentifier]
$sel:trafficSources:DetachTrafficSources' :: DetachTrafficSources -> [TrafficSourceIdentifier]
trafficSources} -> [TrafficSourceIdentifier]
trafficSources) (\s :: DetachTrafficSources
s@DetachTrafficSources' {} [TrafficSourceIdentifier]
a -> DetachTrafficSources
s {$sel:trafficSources:DetachTrafficSources' :: [TrafficSourceIdentifier]
trafficSources = [TrafficSourceIdentifier]
a} :: DetachTrafficSources) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DetachTrafficSources where
type
AWSResponse DetachTrafficSources =
DetachTrafficSourcesResponse
request :: (Service -> Service)
-> DetachTrafficSources -> Request DetachTrafficSources
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DetachTrafficSources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DetachTrafficSources)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"DetachTrafficSourcesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> DetachTrafficSourcesResponse
DetachTrafficSourcesResponse'
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 DetachTrafficSources where
hashWithSalt :: Int -> DetachTrafficSources -> Int
hashWithSalt Int
_salt DetachTrafficSources' {[TrafficSourceIdentifier]
Text
trafficSources :: [TrafficSourceIdentifier]
autoScalingGroupName :: Text
$sel:trafficSources:DetachTrafficSources' :: DetachTrafficSources -> [TrafficSourceIdentifier]
$sel:autoScalingGroupName:DetachTrafficSources' :: DetachTrafficSources -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
autoScalingGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [TrafficSourceIdentifier]
trafficSources
instance Prelude.NFData DetachTrafficSources where
rnf :: DetachTrafficSources -> ()
rnf DetachTrafficSources' {[TrafficSourceIdentifier]
Text
trafficSources :: [TrafficSourceIdentifier]
autoScalingGroupName :: Text
$sel:trafficSources:DetachTrafficSources' :: DetachTrafficSources -> [TrafficSourceIdentifier]
$sel:autoScalingGroupName:DetachTrafficSources' :: DetachTrafficSources -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
autoScalingGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [TrafficSourceIdentifier]
trafficSources
instance Data.ToHeaders DetachTrafficSources where
toHeaders :: DetachTrafficSources -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DetachTrafficSources where
toPath :: DetachTrafficSources -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DetachTrafficSources where
toQuery :: DetachTrafficSources -> QueryString
toQuery DetachTrafficSources' {[TrafficSourceIdentifier]
Text
trafficSources :: [TrafficSourceIdentifier]
autoScalingGroupName :: Text
$sel:trafficSources:DetachTrafficSources' :: DetachTrafficSources -> [TrafficSourceIdentifier]
$sel:autoScalingGroupName:DetachTrafficSources' :: DetachTrafficSources -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DetachTrafficSources" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
ByteString
"AutoScalingGroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
autoScalingGroupName,
ByteString
"TrafficSources"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" [TrafficSourceIdentifier]
trafficSources
]
data DetachTrafficSourcesResponse = DetachTrafficSourcesResponse'
{
DetachTrafficSourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DetachTrafficSourcesResponse
-> DetachTrafficSourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DetachTrafficSourcesResponse
-> DetachTrafficSourcesResponse -> Bool
$c/= :: DetachTrafficSourcesResponse
-> DetachTrafficSourcesResponse -> Bool
== :: DetachTrafficSourcesResponse
-> DetachTrafficSourcesResponse -> Bool
$c== :: DetachTrafficSourcesResponse
-> DetachTrafficSourcesResponse -> Bool
Prelude.Eq, ReadPrec [DetachTrafficSourcesResponse]
ReadPrec DetachTrafficSourcesResponse
Int -> ReadS DetachTrafficSourcesResponse
ReadS [DetachTrafficSourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DetachTrafficSourcesResponse]
$creadListPrec :: ReadPrec [DetachTrafficSourcesResponse]
readPrec :: ReadPrec DetachTrafficSourcesResponse
$creadPrec :: ReadPrec DetachTrafficSourcesResponse
readList :: ReadS [DetachTrafficSourcesResponse]
$creadList :: ReadS [DetachTrafficSourcesResponse]
readsPrec :: Int -> ReadS DetachTrafficSourcesResponse
$creadsPrec :: Int -> ReadS DetachTrafficSourcesResponse
Prelude.Read, Int -> DetachTrafficSourcesResponse -> ShowS
[DetachTrafficSourcesResponse] -> ShowS
DetachTrafficSourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DetachTrafficSourcesResponse] -> ShowS
$cshowList :: [DetachTrafficSourcesResponse] -> ShowS
show :: DetachTrafficSourcesResponse -> String
$cshow :: DetachTrafficSourcesResponse -> String
showsPrec :: Int -> DetachTrafficSourcesResponse -> ShowS
$cshowsPrec :: Int -> DetachTrafficSourcesResponse -> ShowS
Prelude.Show, forall x.
Rep DetachTrafficSourcesResponse x -> DetachTrafficSourcesResponse
forall x.
DetachTrafficSourcesResponse -> Rep DetachTrafficSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DetachTrafficSourcesResponse x -> DetachTrafficSourcesResponse
$cfrom :: forall x.
DetachTrafficSourcesResponse -> Rep DetachTrafficSourcesResponse x
Prelude.Generic)
newDetachTrafficSourcesResponse ::
Prelude.Int ->
DetachTrafficSourcesResponse
newDetachTrafficSourcesResponse :: Int -> DetachTrafficSourcesResponse
newDetachTrafficSourcesResponse Int
pHttpStatus_ =
DetachTrafficSourcesResponse'
{ $sel:httpStatus:DetachTrafficSourcesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
detachTrafficSourcesResponse_httpStatus :: Lens.Lens' DetachTrafficSourcesResponse Prelude.Int
detachTrafficSourcesResponse_httpStatus :: Lens' DetachTrafficSourcesResponse Int
detachTrafficSourcesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DetachTrafficSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetachTrafficSourcesResponse' :: DetachTrafficSourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DetachTrafficSourcesResponse
s@DetachTrafficSourcesResponse' {} Int
a -> DetachTrafficSourcesResponse
s {$sel:httpStatus:DetachTrafficSourcesResponse' :: Int
httpStatus = Int
a} :: DetachTrafficSourcesResponse)
instance Prelude.NFData DetachTrafficSourcesResponse where
rnf :: DetachTrafficSourcesResponse -> ()
rnf DetachTrafficSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DetachTrafficSourcesResponse' :: DetachTrafficSourcesResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus