{-# 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.AttachTrafficSources
(
AttachTrafficSources (..),
newAttachTrafficSources,
attachTrafficSources_autoScalingGroupName,
attachTrafficSources_trafficSources,
AttachTrafficSourcesResponse (..),
newAttachTrafficSourcesResponse,
attachTrafficSourcesResponse_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 AttachTrafficSources = AttachTrafficSources'
{
AttachTrafficSources -> Text
autoScalingGroupName :: Prelude.Text,
AttachTrafficSources -> [TrafficSourceIdentifier]
trafficSources :: [TrafficSourceIdentifier]
}
deriving (AttachTrafficSources -> AttachTrafficSources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachTrafficSources -> AttachTrafficSources -> Bool
$c/= :: AttachTrafficSources -> AttachTrafficSources -> Bool
== :: AttachTrafficSources -> AttachTrafficSources -> Bool
$c== :: AttachTrafficSources -> AttachTrafficSources -> Bool
Prelude.Eq, ReadPrec [AttachTrafficSources]
ReadPrec AttachTrafficSources
Int -> ReadS AttachTrafficSources
ReadS [AttachTrafficSources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachTrafficSources]
$creadListPrec :: ReadPrec [AttachTrafficSources]
readPrec :: ReadPrec AttachTrafficSources
$creadPrec :: ReadPrec AttachTrafficSources
readList :: ReadS [AttachTrafficSources]
$creadList :: ReadS [AttachTrafficSources]
readsPrec :: Int -> ReadS AttachTrafficSources
$creadsPrec :: Int -> ReadS AttachTrafficSources
Prelude.Read, Int -> AttachTrafficSources -> ShowS
[AttachTrafficSources] -> ShowS
AttachTrafficSources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachTrafficSources] -> ShowS
$cshowList :: [AttachTrafficSources] -> ShowS
show :: AttachTrafficSources -> String
$cshow :: AttachTrafficSources -> String
showsPrec :: Int -> AttachTrafficSources -> ShowS
$cshowsPrec :: Int -> AttachTrafficSources -> ShowS
Prelude.Show, forall x. Rep AttachTrafficSources x -> AttachTrafficSources
forall x. AttachTrafficSources -> Rep AttachTrafficSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttachTrafficSources x -> AttachTrafficSources
$cfrom :: forall x. AttachTrafficSources -> Rep AttachTrafficSources x
Prelude.Generic)
newAttachTrafficSources ::
Prelude.Text ->
AttachTrafficSources
newAttachTrafficSources :: Text -> AttachTrafficSources
newAttachTrafficSources Text
pAutoScalingGroupName_ =
AttachTrafficSources'
{ $sel:autoScalingGroupName:AttachTrafficSources' :: Text
autoScalingGroupName =
Text
pAutoScalingGroupName_,
$sel:trafficSources:AttachTrafficSources' :: [TrafficSourceIdentifier]
trafficSources = forall a. Monoid a => a
Prelude.mempty
}
attachTrafficSources_autoScalingGroupName :: Lens.Lens' AttachTrafficSources Prelude.Text
attachTrafficSources_autoScalingGroupName :: Lens' AttachTrafficSources Text
attachTrafficSources_autoScalingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachTrafficSources' {Text
autoScalingGroupName :: Text
$sel:autoScalingGroupName:AttachTrafficSources' :: AttachTrafficSources -> Text
autoScalingGroupName} -> Text
autoScalingGroupName) (\s :: AttachTrafficSources
s@AttachTrafficSources' {} Text
a -> AttachTrafficSources
s {$sel:autoScalingGroupName:AttachTrafficSources' :: Text
autoScalingGroupName = Text
a} :: AttachTrafficSources)
attachTrafficSources_trafficSources :: Lens.Lens' AttachTrafficSources [TrafficSourceIdentifier]
attachTrafficSources_trafficSources :: Lens' AttachTrafficSources [TrafficSourceIdentifier]
attachTrafficSources_trafficSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachTrafficSources' {[TrafficSourceIdentifier]
trafficSources :: [TrafficSourceIdentifier]
$sel:trafficSources:AttachTrafficSources' :: AttachTrafficSources -> [TrafficSourceIdentifier]
trafficSources} -> [TrafficSourceIdentifier]
trafficSources) (\s :: AttachTrafficSources
s@AttachTrafficSources' {} [TrafficSourceIdentifier]
a -> AttachTrafficSources
s {$sel:trafficSources:AttachTrafficSources' :: [TrafficSourceIdentifier]
trafficSources = [TrafficSourceIdentifier]
a} :: AttachTrafficSources) 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 AttachTrafficSources where
type
AWSResponse AttachTrafficSources =
AttachTrafficSourcesResponse
request :: (Service -> Service)
-> AttachTrafficSources -> Request AttachTrafficSources
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 AttachTrafficSources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AttachTrafficSources)))
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
"AttachTrafficSourcesResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> AttachTrafficSourcesResponse
AttachTrafficSourcesResponse'
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 AttachTrafficSources where
hashWithSalt :: Int -> AttachTrafficSources -> Int
hashWithSalt Int
_salt AttachTrafficSources' {[TrafficSourceIdentifier]
Text
trafficSources :: [TrafficSourceIdentifier]
autoScalingGroupName :: Text
$sel:trafficSources:AttachTrafficSources' :: AttachTrafficSources -> [TrafficSourceIdentifier]
$sel:autoScalingGroupName:AttachTrafficSources' :: AttachTrafficSources -> 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 AttachTrafficSources where
rnf :: AttachTrafficSources -> ()
rnf AttachTrafficSources' {[TrafficSourceIdentifier]
Text
trafficSources :: [TrafficSourceIdentifier]
autoScalingGroupName :: Text
$sel:trafficSources:AttachTrafficSources' :: AttachTrafficSources -> [TrafficSourceIdentifier]
$sel:autoScalingGroupName:AttachTrafficSources' :: AttachTrafficSources -> 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 AttachTrafficSources where
toHeaders :: AttachTrafficSources -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath AttachTrafficSources where
toPath :: AttachTrafficSources -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AttachTrafficSources where
toQuery :: AttachTrafficSources -> QueryString
toQuery AttachTrafficSources' {[TrafficSourceIdentifier]
Text
trafficSources :: [TrafficSourceIdentifier]
autoScalingGroupName :: Text
$sel:trafficSources:AttachTrafficSources' :: AttachTrafficSources -> [TrafficSourceIdentifier]
$sel:autoScalingGroupName:AttachTrafficSources' :: AttachTrafficSources -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"AttachTrafficSources" :: 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 AttachTrafficSourcesResponse = AttachTrafficSourcesResponse'
{
AttachTrafficSourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AttachTrafficSourcesResponse
-> AttachTrafficSourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachTrafficSourcesResponse
-> AttachTrafficSourcesResponse -> Bool
$c/= :: AttachTrafficSourcesResponse
-> AttachTrafficSourcesResponse -> Bool
== :: AttachTrafficSourcesResponse
-> AttachTrafficSourcesResponse -> Bool
$c== :: AttachTrafficSourcesResponse
-> AttachTrafficSourcesResponse -> Bool
Prelude.Eq, ReadPrec [AttachTrafficSourcesResponse]
ReadPrec AttachTrafficSourcesResponse
Int -> ReadS AttachTrafficSourcesResponse
ReadS [AttachTrafficSourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachTrafficSourcesResponse]
$creadListPrec :: ReadPrec [AttachTrafficSourcesResponse]
readPrec :: ReadPrec AttachTrafficSourcesResponse
$creadPrec :: ReadPrec AttachTrafficSourcesResponse
readList :: ReadS [AttachTrafficSourcesResponse]
$creadList :: ReadS [AttachTrafficSourcesResponse]
readsPrec :: Int -> ReadS AttachTrafficSourcesResponse
$creadsPrec :: Int -> ReadS AttachTrafficSourcesResponse
Prelude.Read, Int -> AttachTrafficSourcesResponse -> ShowS
[AttachTrafficSourcesResponse] -> ShowS
AttachTrafficSourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachTrafficSourcesResponse] -> ShowS
$cshowList :: [AttachTrafficSourcesResponse] -> ShowS
show :: AttachTrafficSourcesResponse -> String
$cshow :: AttachTrafficSourcesResponse -> String
showsPrec :: Int -> AttachTrafficSourcesResponse -> ShowS
$cshowsPrec :: Int -> AttachTrafficSourcesResponse -> ShowS
Prelude.Show, forall x.
Rep AttachTrafficSourcesResponse x -> AttachTrafficSourcesResponse
forall x.
AttachTrafficSourcesResponse -> Rep AttachTrafficSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachTrafficSourcesResponse x -> AttachTrafficSourcesResponse
$cfrom :: forall x.
AttachTrafficSourcesResponse -> Rep AttachTrafficSourcesResponse x
Prelude.Generic)
newAttachTrafficSourcesResponse ::
Prelude.Int ->
AttachTrafficSourcesResponse
newAttachTrafficSourcesResponse :: Int -> AttachTrafficSourcesResponse
newAttachTrafficSourcesResponse Int
pHttpStatus_ =
AttachTrafficSourcesResponse'
{ $sel:httpStatus:AttachTrafficSourcesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
attachTrafficSourcesResponse_httpStatus :: Lens.Lens' AttachTrafficSourcesResponse Prelude.Int
attachTrafficSourcesResponse_httpStatus :: Lens' AttachTrafficSourcesResponse Int
attachTrafficSourcesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachTrafficSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:AttachTrafficSourcesResponse' :: AttachTrafficSourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AttachTrafficSourcesResponse
s@AttachTrafficSourcesResponse' {} Int
a -> AttachTrafficSourcesResponse
s {$sel:httpStatus:AttachTrafficSourcesResponse' :: Int
httpStatus = Int
a} :: AttachTrafficSourcesResponse)
instance Prelude.NFData AttachTrafficSourcesResponse where
rnf :: AttachTrafficSourcesResponse -> ()
rnf AttachTrafficSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:AttachTrafficSourcesResponse' :: AttachTrafficSourcesResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus