{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ELB.ApplySecurityGroupsToLoadBalancer
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Associates one or more security groups with your load balancer in a
-- virtual private cloud (VPC). The specified security groups override the
-- previously associated security groups.
--
-- For more information, see
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-security-groups.html#elb-vpc-security-groups Security Groups for Load Balancers in a VPC>
-- in the /Classic Load Balancers Guide/.
module Amazonka.ELB.ApplySecurityGroupsToLoadBalancer
  ( -- * Creating a Request
    ApplySecurityGroupsToLoadBalancer (..),
    newApplySecurityGroupsToLoadBalancer,

    -- * Request Lenses
    applySecurityGroupsToLoadBalancer_loadBalancerName,
    applySecurityGroupsToLoadBalancer_securityGroups,

    -- * Destructuring the Response
    ApplySecurityGroupsToLoadBalancerResponse (..),
    newApplySecurityGroupsToLoadBalancerResponse,

    -- * Response Lenses
    applySecurityGroupsToLoadBalancerResponse_securityGroups,
    applySecurityGroupsToLoadBalancerResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ELB.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Contains the parameters for ApplySecurityGroupsToLoadBalancer.
--
-- /See:/ 'newApplySecurityGroupsToLoadBalancer' smart constructor.
data ApplySecurityGroupsToLoadBalancer = ApplySecurityGroupsToLoadBalancer'
  { -- | The name of the load balancer.
    ApplySecurityGroupsToLoadBalancer -> Text
loadBalancerName :: Prelude.Text,
    -- | The IDs of the security groups to associate with the load balancer. Note
    -- that you cannot specify the name of the security group.
    ApplySecurityGroupsToLoadBalancer -> [Text]
securityGroups :: [Prelude.Text]
  }
  deriving (ApplySecurityGroupsToLoadBalancer
-> ApplySecurityGroupsToLoadBalancer -> Bool
(ApplySecurityGroupsToLoadBalancer
 -> ApplySecurityGroupsToLoadBalancer -> Bool)
-> (ApplySecurityGroupsToLoadBalancer
    -> ApplySecurityGroupsToLoadBalancer -> Bool)
-> Eq ApplySecurityGroupsToLoadBalancer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplySecurityGroupsToLoadBalancer
-> ApplySecurityGroupsToLoadBalancer -> Bool
$c/= :: ApplySecurityGroupsToLoadBalancer
-> ApplySecurityGroupsToLoadBalancer -> Bool
== :: ApplySecurityGroupsToLoadBalancer
-> ApplySecurityGroupsToLoadBalancer -> Bool
$c== :: ApplySecurityGroupsToLoadBalancer
-> ApplySecurityGroupsToLoadBalancer -> Bool
Prelude.Eq, ReadPrec [ApplySecurityGroupsToLoadBalancer]
ReadPrec ApplySecurityGroupsToLoadBalancer
Int -> ReadS ApplySecurityGroupsToLoadBalancer
ReadS [ApplySecurityGroupsToLoadBalancer]
(Int -> ReadS ApplySecurityGroupsToLoadBalancer)
-> ReadS [ApplySecurityGroupsToLoadBalancer]
-> ReadPrec ApplySecurityGroupsToLoadBalancer
-> ReadPrec [ApplySecurityGroupsToLoadBalancer]
-> Read ApplySecurityGroupsToLoadBalancer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplySecurityGroupsToLoadBalancer]
$creadListPrec :: ReadPrec [ApplySecurityGroupsToLoadBalancer]
readPrec :: ReadPrec ApplySecurityGroupsToLoadBalancer
$creadPrec :: ReadPrec ApplySecurityGroupsToLoadBalancer
readList :: ReadS [ApplySecurityGroupsToLoadBalancer]
$creadList :: ReadS [ApplySecurityGroupsToLoadBalancer]
readsPrec :: Int -> ReadS ApplySecurityGroupsToLoadBalancer
$creadsPrec :: Int -> ReadS ApplySecurityGroupsToLoadBalancer
Prelude.Read, Int -> ApplySecurityGroupsToLoadBalancer -> ShowS
[ApplySecurityGroupsToLoadBalancer] -> ShowS
ApplySecurityGroupsToLoadBalancer -> String
(Int -> ApplySecurityGroupsToLoadBalancer -> ShowS)
-> (ApplySecurityGroupsToLoadBalancer -> String)
-> ([ApplySecurityGroupsToLoadBalancer] -> ShowS)
-> Show ApplySecurityGroupsToLoadBalancer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplySecurityGroupsToLoadBalancer] -> ShowS
$cshowList :: [ApplySecurityGroupsToLoadBalancer] -> ShowS
show :: ApplySecurityGroupsToLoadBalancer -> String
$cshow :: ApplySecurityGroupsToLoadBalancer -> String
showsPrec :: Int -> ApplySecurityGroupsToLoadBalancer -> ShowS
$cshowsPrec :: Int -> ApplySecurityGroupsToLoadBalancer -> ShowS
Prelude.Show, (forall x.
 ApplySecurityGroupsToLoadBalancer
 -> Rep ApplySecurityGroupsToLoadBalancer x)
-> (forall x.
    Rep ApplySecurityGroupsToLoadBalancer x
    -> ApplySecurityGroupsToLoadBalancer)
-> Generic ApplySecurityGroupsToLoadBalancer
forall x.
Rep ApplySecurityGroupsToLoadBalancer x
-> ApplySecurityGroupsToLoadBalancer
forall x.
ApplySecurityGroupsToLoadBalancer
-> Rep ApplySecurityGroupsToLoadBalancer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplySecurityGroupsToLoadBalancer x
-> ApplySecurityGroupsToLoadBalancer
$cfrom :: forall x.
ApplySecurityGroupsToLoadBalancer
-> Rep ApplySecurityGroupsToLoadBalancer x
Prelude.Generic)

-- |
-- Create a value of 'ApplySecurityGroupsToLoadBalancer' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'loadBalancerName', 'applySecurityGroupsToLoadBalancer_loadBalancerName' - The name of the load balancer.
--
-- 'securityGroups', 'applySecurityGroupsToLoadBalancer_securityGroups' - The IDs of the security groups to associate with the load balancer. Note
-- that you cannot specify the name of the security group.
newApplySecurityGroupsToLoadBalancer ::
  -- | 'loadBalancerName'
  Prelude.Text ->
  ApplySecurityGroupsToLoadBalancer
newApplySecurityGroupsToLoadBalancer :: Text -> ApplySecurityGroupsToLoadBalancer
newApplySecurityGroupsToLoadBalancer
  Text
pLoadBalancerName_ =
    ApplySecurityGroupsToLoadBalancer' :: Text -> [Text] -> ApplySecurityGroupsToLoadBalancer
ApplySecurityGroupsToLoadBalancer'
      { $sel:loadBalancerName:ApplySecurityGroupsToLoadBalancer' :: Text
loadBalancerName =
          Text
pLoadBalancerName_,
        $sel:securityGroups:ApplySecurityGroupsToLoadBalancer' :: [Text]
securityGroups = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The name of the load balancer.
applySecurityGroupsToLoadBalancer_loadBalancerName :: Lens.Lens' ApplySecurityGroupsToLoadBalancer Prelude.Text
applySecurityGroupsToLoadBalancer_loadBalancerName :: (Text -> f Text)
-> ApplySecurityGroupsToLoadBalancer
-> f ApplySecurityGroupsToLoadBalancer
applySecurityGroupsToLoadBalancer_loadBalancerName = (ApplySecurityGroupsToLoadBalancer -> Text)
-> (ApplySecurityGroupsToLoadBalancer
    -> Text -> ApplySecurityGroupsToLoadBalancer)
-> Lens
     ApplySecurityGroupsToLoadBalancer
     ApplySecurityGroupsToLoadBalancer
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplySecurityGroupsToLoadBalancer' {Text
loadBalancerName :: Text
$sel:loadBalancerName:ApplySecurityGroupsToLoadBalancer' :: ApplySecurityGroupsToLoadBalancer -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: ApplySecurityGroupsToLoadBalancer
s@ApplySecurityGroupsToLoadBalancer' {} Text
a -> ApplySecurityGroupsToLoadBalancer
s {$sel:loadBalancerName:ApplySecurityGroupsToLoadBalancer' :: Text
loadBalancerName = Text
a} :: ApplySecurityGroupsToLoadBalancer)

-- | The IDs of the security groups to associate with the load balancer. Note
-- that you cannot specify the name of the security group.
applySecurityGroupsToLoadBalancer_securityGroups :: Lens.Lens' ApplySecurityGroupsToLoadBalancer [Prelude.Text]
applySecurityGroupsToLoadBalancer_securityGroups :: ([Text] -> f [Text])
-> ApplySecurityGroupsToLoadBalancer
-> f ApplySecurityGroupsToLoadBalancer
applySecurityGroupsToLoadBalancer_securityGroups = (ApplySecurityGroupsToLoadBalancer -> [Text])
-> (ApplySecurityGroupsToLoadBalancer
    -> [Text] -> ApplySecurityGroupsToLoadBalancer)
-> Lens
     ApplySecurityGroupsToLoadBalancer
     ApplySecurityGroupsToLoadBalancer
     [Text]
     [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplySecurityGroupsToLoadBalancer' {[Text]
securityGroups :: [Text]
$sel:securityGroups:ApplySecurityGroupsToLoadBalancer' :: ApplySecurityGroupsToLoadBalancer -> [Text]
securityGroups} -> [Text]
securityGroups) (\s :: ApplySecurityGroupsToLoadBalancer
s@ApplySecurityGroupsToLoadBalancer' {} [Text]
a -> ApplySecurityGroupsToLoadBalancer
s {$sel:securityGroups:ApplySecurityGroupsToLoadBalancer' :: [Text]
securityGroups = [Text]
a} :: ApplySecurityGroupsToLoadBalancer) (([Text] -> f [Text])
 -> ApplySecurityGroupsToLoadBalancer
 -> f ApplySecurityGroupsToLoadBalancer)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ApplySecurityGroupsToLoadBalancer
-> f ApplySecurityGroupsToLoadBalancer
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
    ApplySecurityGroupsToLoadBalancer
  where
  type
    AWSResponse ApplySecurityGroupsToLoadBalancer =
      ApplySecurityGroupsToLoadBalancerResponse
  request :: ApplySecurityGroupsToLoadBalancer
-> Request ApplySecurityGroupsToLoadBalancer
request = Service
-> ApplySecurityGroupsToLoadBalancer
-> Request ApplySecurityGroupsToLoadBalancer
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy ApplySecurityGroupsToLoadBalancer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ApplySecurityGroupsToLoadBalancer)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse ApplySecurityGroupsToLoadBalancer))
-> Logger
-> Service
-> Proxy ApplySecurityGroupsToLoadBalancer
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ApplySecurityGroupsToLoadBalancer)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"ApplySecurityGroupsToLoadBalancerResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [Text] -> Int -> ApplySecurityGroupsToLoadBalancerResponse
ApplySecurityGroupsToLoadBalancerResponse'
            (Maybe [Text] -> Int -> ApplySecurityGroupsToLoadBalancerResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ApplySecurityGroupsToLoadBalancerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SecurityGroups" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
              Either String (Int -> ApplySecurityGroupsToLoadBalancerResponse)
-> Either String Int
-> Either String ApplySecurityGroupsToLoadBalancerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ApplySecurityGroupsToLoadBalancer

instance
  Prelude.NFData
    ApplySecurityGroupsToLoadBalancer

instance
  Core.ToHeaders
    ApplySecurityGroupsToLoadBalancer
  where
  toHeaders :: ApplySecurityGroupsToLoadBalancer -> ResponseHeaders
toHeaders = ResponseHeaders
-> ApplySecurityGroupsToLoadBalancer -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance
  Core.ToPath
    ApplySecurityGroupsToLoadBalancer
  where
  toPath :: ApplySecurityGroupsToLoadBalancer -> ByteString
toPath = ByteString -> ApplySecurityGroupsToLoadBalancer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Core.ToQuery
    ApplySecurityGroupsToLoadBalancer
  where
  toQuery :: ApplySecurityGroupsToLoadBalancer -> QueryString
toQuery ApplySecurityGroupsToLoadBalancer' {[Text]
Text
securityGroups :: [Text]
loadBalancerName :: Text
$sel:securityGroups:ApplySecurityGroupsToLoadBalancer' :: ApplySecurityGroupsToLoadBalancer -> [Text]
$sel:loadBalancerName:ApplySecurityGroupsToLoadBalancer' :: ApplySecurityGroupsToLoadBalancer -> 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
"ApplySecurityGroupsToLoadBalancer" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-06-01" :: Prelude.ByteString),
        ByteString
"LoadBalancerName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
loadBalancerName,
        ByteString
"SecurityGroups"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
securityGroups
      ]

-- | Contains the output of ApplySecurityGroupsToLoadBalancer.
--
-- /See:/ 'newApplySecurityGroupsToLoadBalancerResponse' smart constructor.
data ApplySecurityGroupsToLoadBalancerResponse = ApplySecurityGroupsToLoadBalancerResponse'
  { -- | The IDs of the security groups associated with the load balancer.
    ApplySecurityGroupsToLoadBalancerResponse -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ApplySecurityGroupsToLoadBalancerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ApplySecurityGroupsToLoadBalancerResponse
-> ApplySecurityGroupsToLoadBalancerResponse -> Bool
(ApplySecurityGroupsToLoadBalancerResponse
 -> ApplySecurityGroupsToLoadBalancerResponse -> Bool)
-> (ApplySecurityGroupsToLoadBalancerResponse
    -> ApplySecurityGroupsToLoadBalancerResponse -> Bool)
-> Eq ApplySecurityGroupsToLoadBalancerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApplySecurityGroupsToLoadBalancerResponse
-> ApplySecurityGroupsToLoadBalancerResponse -> Bool
$c/= :: ApplySecurityGroupsToLoadBalancerResponse
-> ApplySecurityGroupsToLoadBalancerResponse -> Bool
== :: ApplySecurityGroupsToLoadBalancerResponse
-> ApplySecurityGroupsToLoadBalancerResponse -> Bool
$c== :: ApplySecurityGroupsToLoadBalancerResponse
-> ApplySecurityGroupsToLoadBalancerResponse -> Bool
Prelude.Eq, ReadPrec [ApplySecurityGroupsToLoadBalancerResponse]
ReadPrec ApplySecurityGroupsToLoadBalancerResponse
Int -> ReadS ApplySecurityGroupsToLoadBalancerResponse
ReadS [ApplySecurityGroupsToLoadBalancerResponse]
(Int -> ReadS ApplySecurityGroupsToLoadBalancerResponse)
-> ReadS [ApplySecurityGroupsToLoadBalancerResponse]
-> ReadPrec ApplySecurityGroupsToLoadBalancerResponse
-> ReadPrec [ApplySecurityGroupsToLoadBalancerResponse]
-> Read ApplySecurityGroupsToLoadBalancerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApplySecurityGroupsToLoadBalancerResponse]
$creadListPrec :: ReadPrec [ApplySecurityGroupsToLoadBalancerResponse]
readPrec :: ReadPrec ApplySecurityGroupsToLoadBalancerResponse
$creadPrec :: ReadPrec ApplySecurityGroupsToLoadBalancerResponse
readList :: ReadS [ApplySecurityGroupsToLoadBalancerResponse]
$creadList :: ReadS [ApplySecurityGroupsToLoadBalancerResponse]
readsPrec :: Int -> ReadS ApplySecurityGroupsToLoadBalancerResponse
$creadsPrec :: Int -> ReadS ApplySecurityGroupsToLoadBalancerResponse
Prelude.Read, Int -> ApplySecurityGroupsToLoadBalancerResponse -> ShowS
[ApplySecurityGroupsToLoadBalancerResponse] -> ShowS
ApplySecurityGroupsToLoadBalancerResponse -> String
(Int -> ApplySecurityGroupsToLoadBalancerResponse -> ShowS)
-> (ApplySecurityGroupsToLoadBalancerResponse -> String)
-> ([ApplySecurityGroupsToLoadBalancerResponse] -> ShowS)
-> Show ApplySecurityGroupsToLoadBalancerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApplySecurityGroupsToLoadBalancerResponse] -> ShowS
$cshowList :: [ApplySecurityGroupsToLoadBalancerResponse] -> ShowS
show :: ApplySecurityGroupsToLoadBalancerResponse -> String
$cshow :: ApplySecurityGroupsToLoadBalancerResponse -> String
showsPrec :: Int -> ApplySecurityGroupsToLoadBalancerResponse -> ShowS
$cshowsPrec :: Int -> ApplySecurityGroupsToLoadBalancerResponse -> ShowS
Prelude.Show, (forall x.
 ApplySecurityGroupsToLoadBalancerResponse
 -> Rep ApplySecurityGroupsToLoadBalancerResponse x)
-> (forall x.
    Rep ApplySecurityGroupsToLoadBalancerResponse x
    -> ApplySecurityGroupsToLoadBalancerResponse)
-> Generic ApplySecurityGroupsToLoadBalancerResponse
forall x.
Rep ApplySecurityGroupsToLoadBalancerResponse x
-> ApplySecurityGroupsToLoadBalancerResponse
forall x.
ApplySecurityGroupsToLoadBalancerResponse
-> Rep ApplySecurityGroupsToLoadBalancerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ApplySecurityGroupsToLoadBalancerResponse x
-> ApplySecurityGroupsToLoadBalancerResponse
$cfrom :: forall x.
ApplySecurityGroupsToLoadBalancerResponse
-> Rep ApplySecurityGroupsToLoadBalancerResponse x
Prelude.Generic)

-- |
-- Create a value of 'ApplySecurityGroupsToLoadBalancerResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'securityGroups', 'applySecurityGroupsToLoadBalancerResponse_securityGroups' - The IDs of the security groups associated with the load balancer.
--
-- 'httpStatus', 'applySecurityGroupsToLoadBalancerResponse_httpStatus' - The response's http status code.
newApplySecurityGroupsToLoadBalancerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ApplySecurityGroupsToLoadBalancerResponse
newApplySecurityGroupsToLoadBalancerResponse :: Int -> ApplySecurityGroupsToLoadBalancerResponse
newApplySecurityGroupsToLoadBalancerResponse
  Int
pHttpStatus_ =
    ApplySecurityGroupsToLoadBalancerResponse' :: Maybe [Text] -> Int -> ApplySecurityGroupsToLoadBalancerResponse
ApplySecurityGroupsToLoadBalancerResponse'
      { $sel:securityGroups:ApplySecurityGroupsToLoadBalancerResponse' :: Maybe [Text]
securityGroups =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ApplySecurityGroupsToLoadBalancerResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The IDs of the security groups associated with the load balancer.
applySecurityGroupsToLoadBalancerResponse_securityGroups :: Lens.Lens' ApplySecurityGroupsToLoadBalancerResponse (Prelude.Maybe [Prelude.Text])
applySecurityGroupsToLoadBalancerResponse_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> ApplySecurityGroupsToLoadBalancerResponse
-> f ApplySecurityGroupsToLoadBalancerResponse
applySecurityGroupsToLoadBalancerResponse_securityGroups = (ApplySecurityGroupsToLoadBalancerResponse -> Maybe [Text])
-> (ApplySecurityGroupsToLoadBalancerResponse
    -> Maybe [Text] -> ApplySecurityGroupsToLoadBalancerResponse)
-> Lens
     ApplySecurityGroupsToLoadBalancerResponse
     ApplySecurityGroupsToLoadBalancerResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplySecurityGroupsToLoadBalancerResponse' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:ApplySecurityGroupsToLoadBalancerResponse' :: ApplySecurityGroupsToLoadBalancerResponse -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: ApplySecurityGroupsToLoadBalancerResponse
s@ApplySecurityGroupsToLoadBalancerResponse' {} Maybe [Text]
a -> ApplySecurityGroupsToLoadBalancerResponse
s {$sel:securityGroups:ApplySecurityGroupsToLoadBalancerResponse' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: ApplySecurityGroupsToLoadBalancerResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ApplySecurityGroupsToLoadBalancerResponse
 -> f ApplySecurityGroupsToLoadBalancerResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ApplySecurityGroupsToLoadBalancerResponse
-> f ApplySecurityGroupsToLoadBalancerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
applySecurityGroupsToLoadBalancerResponse_httpStatus :: Lens.Lens' ApplySecurityGroupsToLoadBalancerResponse Prelude.Int
applySecurityGroupsToLoadBalancerResponse_httpStatus :: (Int -> f Int)
-> ApplySecurityGroupsToLoadBalancerResponse
-> f ApplySecurityGroupsToLoadBalancerResponse
applySecurityGroupsToLoadBalancerResponse_httpStatus = (ApplySecurityGroupsToLoadBalancerResponse -> Int)
-> (ApplySecurityGroupsToLoadBalancerResponse
    -> Int -> ApplySecurityGroupsToLoadBalancerResponse)
-> Lens
     ApplySecurityGroupsToLoadBalancerResponse
     ApplySecurityGroupsToLoadBalancerResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApplySecurityGroupsToLoadBalancerResponse' {Int
httpStatus :: Int
$sel:httpStatus:ApplySecurityGroupsToLoadBalancerResponse' :: ApplySecurityGroupsToLoadBalancerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ApplySecurityGroupsToLoadBalancerResponse
s@ApplySecurityGroupsToLoadBalancerResponse' {} Int
a -> ApplySecurityGroupsToLoadBalancerResponse
s {$sel:httpStatus:ApplySecurityGroupsToLoadBalancerResponse' :: Int
httpStatus = Int
a} :: ApplySecurityGroupsToLoadBalancerResponse)

instance
  Prelude.NFData
    ApplySecurityGroupsToLoadBalancerResponse