{-# 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.EC2.UpdateSecurityGroupRuleDescriptionsEgress
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- [VPC only] Updates the description of an egress (outbound) security
-- group rule. You can replace an existing description, or add a
-- description to a rule that did not have one previously. You can remove a
-- description for a security group rule by omitting the description
-- parameter in the request.
module Amazonka.EC2.UpdateSecurityGroupRuleDescriptionsEgress
  ( -- * Creating a Request
    UpdateSecurityGroupRuleDescriptionsEgress (..),
    newUpdateSecurityGroupRuleDescriptionsEgress,

    -- * Request Lenses
    updateSecurityGroupRuleDescriptionsEgress_dryRun,
    updateSecurityGroupRuleDescriptionsEgress_groupId,
    updateSecurityGroupRuleDescriptionsEgress_groupName,
    updateSecurityGroupRuleDescriptionsEgress_ipPermissions,
    updateSecurityGroupRuleDescriptionsEgress_securityGroupRuleDescriptions,

    -- * Destructuring the Response
    UpdateSecurityGroupRuleDescriptionsEgressResponse (..),
    newUpdateSecurityGroupRuleDescriptionsEgressResponse,

    -- * Response Lenses
    updateSecurityGroupRuleDescriptionsEgressResponse_return,
    updateSecurityGroupRuleDescriptionsEgressResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateSecurityGroupRuleDescriptionsEgress' smart constructor.
data UpdateSecurityGroupRuleDescriptionsEgress = UpdateSecurityGroupRuleDescriptionsEgress'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the security group. You must specify either the security group
    -- ID or the security group name in the request. For security groups in a
    -- nondefault VPC, you must specify the security group ID.
    UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
groupId :: Prelude.Maybe Prelude.Text,
    -- | [Default VPC] The name of the security group. You must specify either
    -- the security group ID or the security group name in the request.
    UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The IP permissions for the security group rule. You must specify either
    -- the IP permissions or the description.
    UpdateSecurityGroupRuleDescriptionsEgress -> Maybe [IpPermission]
ipPermissions :: Prelude.Maybe [IpPermission],
    -- | The description for the egress security group rules. You must specify
    -- either the description or the IP permissions.
    UpdateSecurityGroupRuleDescriptionsEgress
-> Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions :: Prelude.Maybe [SecurityGroupRuleDescription]
  }
  deriving (UpdateSecurityGroupRuleDescriptionsEgress
-> UpdateSecurityGroupRuleDescriptionsEgress -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecurityGroupRuleDescriptionsEgress
-> UpdateSecurityGroupRuleDescriptionsEgress -> Bool
$c/= :: UpdateSecurityGroupRuleDescriptionsEgress
-> UpdateSecurityGroupRuleDescriptionsEgress -> Bool
== :: UpdateSecurityGroupRuleDescriptionsEgress
-> UpdateSecurityGroupRuleDescriptionsEgress -> Bool
$c== :: UpdateSecurityGroupRuleDescriptionsEgress
-> UpdateSecurityGroupRuleDescriptionsEgress -> Bool
Prelude.Eq, ReadPrec [UpdateSecurityGroupRuleDescriptionsEgress]
ReadPrec UpdateSecurityGroupRuleDescriptionsEgress
Int -> ReadS UpdateSecurityGroupRuleDescriptionsEgress
ReadS [UpdateSecurityGroupRuleDescriptionsEgress]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecurityGroupRuleDescriptionsEgress]
$creadListPrec :: ReadPrec [UpdateSecurityGroupRuleDescriptionsEgress]
readPrec :: ReadPrec UpdateSecurityGroupRuleDescriptionsEgress
$creadPrec :: ReadPrec UpdateSecurityGroupRuleDescriptionsEgress
readList :: ReadS [UpdateSecurityGroupRuleDescriptionsEgress]
$creadList :: ReadS [UpdateSecurityGroupRuleDescriptionsEgress]
readsPrec :: Int -> ReadS UpdateSecurityGroupRuleDescriptionsEgress
$creadsPrec :: Int -> ReadS UpdateSecurityGroupRuleDescriptionsEgress
Prelude.Read, Int -> UpdateSecurityGroupRuleDescriptionsEgress -> ShowS
[UpdateSecurityGroupRuleDescriptionsEgress] -> ShowS
UpdateSecurityGroupRuleDescriptionsEgress -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecurityGroupRuleDescriptionsEgress] -> ShowS
$cshowList :: [UpdateSecurityGroupRuleDescriptionsEgress] -> ShowS
show :: UpdateSecurityGroupRuleDescriptionsEgress -> String
$cshow :: UpdateSecurityGroupRuleDescriptionsEgress -> String
showsPrec :: Int -> UpdateSecurityGroupRuleDescriptionsEgress -> ShowS
$cshowsPrec :: Int -> UpdateSecurityGroupRuleDescriptionsEgress -> ShowS
Prelude.Show, forall x.
Rep UpdateSecurityGroupRuleDescriptionsEgress x
-> UpdateSecurityGroupRuleDescriptionsEgress
forall x.
UpdateSecurityGroupRuleDescriptionsEgress
-> Rep UpdateSecurityGroupRuleDescriptionsEgress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSecurityGroupRuleDescriptionsEgress x
-> UpdateSecurityGroupRuleDescriptionsEgress
$cfrom :: forall x.
UpdateSecurityGroupRuleDescriptionsEgress
-> Rep UpdateSecurityGroupRuleDescriptionsEgress x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSecurityGroupRuleDescriptionsEgress' 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:
--
-- 'dryRun', 'updateSecurityGroupRuleDescriptionsEgress_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'groupId', 'updateSecurityGroupRuleDescriptionsEgress_groupId' - The ID of the security group. You must specify either the security group
-- ID or the security group name in the request. For security groups in a
-- nondefault VPC, you must specify the security group ID.
--
-- 'groupName', 'updateSecurityGroupRuleDescriptionsEgress_groupName' - [Default VPC] The name of the security group. You must specify either
-- the security group ID or the security group name in the request.
--
-- 'ipPermissions', 'updateSecurityGroupRuleDescriptionsEgress_ipPermissions' - The IP permissions for the security group rule. You must specify either
-- the IP permissions or the description.
--
-- 'securityGroupRuleDescriptions', 'updateSecurityGroupRuleDescriptionsEgress_securityGroupRuleDescriptions' - The description for the egress security group rules. You must specify
-- either the description or the IP permissions.
newUpdateSecurityGroupRuleDescriptionsEgress ::
  UpdateSecurityGroupRuleDescriptionsEgress
newUpdateSecurityGroupRuleDescriptionsEgress :: UpdateSecurityGroupRuleDescriptionsEgress
newUpdateSecurityGroupRuleDescriptionsEgress =
  UpdateSecurityGroupRuleDescriptionsEgress'
    { $sel:dryRun:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:groupId:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe Text
groupId = forall a. Maybe a
Prelude.Nothing,
      $sel:groupName:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe Text
groupName = forall a. Maybe a
Prelude.Nothing,
      $sel:ipPermissions:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe [IpPermission]
ipPermissions = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupRuleDescriptions:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
updateSecurityGroupRuleDescriptionsEgress_dryRun :: Lens.Lens' UpdateSecurityGroupRuleDescriptionsEgress (Prelude.Maybe Prelude.Bool)
updateSecurityGroupRuleDescriptionsEgress_dryRun :: Lens' UpdateSecurityGroupRuleDescriptionsEgress (Maybe Bool)
updateSecurityGroupRuleDescriptionsEgress_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityGroupRuleDescriptionsEgress' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: UpdateSecurityGroupRuleDescriptionsEgress
s@UpdateSecurityGroupRuleDescriptionsEgress' {} Maybe Bool
a -> UpdateSecurityGroupRuleDescriptionsEgress
s {$sel:dryRun:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe Bool
dryRun = Maybe Bool
a} :: UpdateSecurityGroupRuleDescriptionsEgress)

-- | The ID of the security group. You must specify either the security group
-- ID or the security group name in the request. For security groups in a
-- nondefault VPC, you must specify the security group ID.
updateSecurityGroupRuleDescriptionsEgress_groupId :: Lens.Lens' UpdateSecurityGroupRuleDescriptionsEgress (Prelude.Maybe Prelude.Text)
updateSecurityGroupRuleDescriptionsEgress_groupId :: Lens' UpdateSecurityGroupRuleDescriptionsEgress (Maybe Text)
updateSecurityGroupRuleDescriptionsEgress_groupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityGroupRuleDescriptionsEgress' {Maybe Text
groupId :: Maybe Text
$sel:groupId:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
groupId} -> Maybe Text
groupId) (\s :: UpdateSecurityGroupRuleDescriptionsEgress
s@UpdateSecurityGroupRuleDescriptionsEgress' {} Maybe Text
a -> UpdateSecurityGroupRuleDescriptionsEgress
s {$sel:groupId:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe Text
groupId = Maybe Text
a} :: UpdateSecurityGroupRuleDescriptionsEgress)

-- | [Default VPC] The name of the security group. You must specify either
-- the security group ID or the security group name in the request.
updateSecurityGroupRuleDescriptionsEgress_groupName :: Lens.Lens' UpdateSecurityGroupRuleDescriptionsEgress (Prelude.Maybe Prelude.Text)
updateSecurityGroupRuleDescriptionsEgress_groupName :: Lens' UpdateSecurityGroupRuleDescriptionsEgress (Maybe Text)
updateSecurityGroupRuleDescriptionsEgress_groupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityGroupRuleDescriptionsEgress' {Maybe Text
groupName :: Maybe Text
$sel:groupName:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: UpdateSecurityGroupRuleDescriptionsEgress
s@UpdateSecurityGroupRuleDescriptionsEgress' {} Maybe Text
a -> UpdateSecurityGroupRuleDescriptionsEgress
s {$sel:groupName:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe Text
groupName = Maybe Text
a} :: UpdateSecurityGroupRuleDescriptionsEgress)

-- | The IP permissions for the security group rule. You must specify either
-- the IP permissions or the description.
updateSecurityGroupRuleDescriptionsEgress_ipPermissions :: Lens.Lens' UpdateSecurityGroupRuleDescriptionsEgress (Prelude.Maybe [IpPermission])
updateSecurityGroupRuleDescriptionsEgress_ipPermissions :: Lens'
  UpdateSecurityGroupRuleDescriptionsEgress (Maybe [IpPermission])
updateSecurityGroupRuleDescriptionsEgress_ipPermissions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityGroupRuleDescriptionsEgress' {Maybe [IpPermission]
ipPermissions :: Maybe [IpPermission]
$sel:ipPermissions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe [IpPermission]
ipPermissions} -> Maybe [IpPermission]
ipPermissions) (\s :: UpdateSecurityGroupRuleDescriptionsEgress
s@UpdateSecurityGroupRuleDescriptionsEgress' {} Maybe [IpPermission]
a -> UpdateSecurityGroupRuleDescriptionsEgress
s {$sel:ipPermissions:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe [IpPermission]
ipPermissions = Maybe [IpPermission]
a} :: UpdateSecurityGroupRuleDescriptionsEgress) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The description for the egress security group rules. You must specify
-- either the description or the IP permissions.
updateSecurityGroupRuleDescriptionsEgress_securityGroupRuleDescriptions :: Lens.Lens' UpdateSecurityGroupRuleDescriptionsEgress (Prelude.Maybe [SecurityGroupRuleDescription])
updateSecurityGroupRuleDescriptionsEgress_securityGroupRuleDescriptions :: Lens'
  UpdateSecurityGroupRuleDescriptionsEgress
  (Maybe [SecurityGroupRuleDescription])
updateSecurityGroupRuleDescriptionsEgress_securityGroupRuleDescriptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityGroupRuleDescriptionsEgress' {Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions :: Maybe [SecurityGroupRuleDescription]
$sel:securityGroupRuleDescriptions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress
-> Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions} -> Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions) (\s :: UpdateSecurityGroupRuleDescriptionsEgress
s@UpdateSecurityGroupRuleDescriptionsEgress' {} Maybe [SecurityGroupRuleDescription]
a -> UpdateSecurityGroupRuleDescriptionsEgress
s {$sel:securityGroupRuleDescriptions:UpdateSecurityGroupRuleDescriptionsEgress' :: Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions = Maybe [SecurityGroupRuleDescription]
a} :: UpdateSecurityGroupRuleDescriptionsEgress) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    UpdateSecurityGroupRuleDescriptionsEgress
  where
  type
    AWSResponse
      UpdateSecurityGroupRuleDescriptionsEgress =
      UpdateSecurityGroupRuleDescriptionsEgressResponse
  request :: (Service -> Service)
-> UpdateSecurityGroupRuleDescriptionsEgress
-> Request UpdateSecurityGroupRuleDescriptionsEgress
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 UpdateSecurityGroupRuleDescriptionsEgress
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateSecurityGroupRuleDescriptionsEgress)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Bool
-> Int -> UpdateSecurityGroupRuleDescriptionsEgressResponse
UpdateSecurityGroupRuleDescriptionsEgressResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"return")
            forall (f :: * -> *) a b. Applicative f => 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
    UpdateSecurityGroupRuleDescriptionsEgress
  where
  hashWithSalt :: Int -> UpdateSecurityGroupRuleDescriptionsEgress -> Int
hashWithSalt
    Int
_salt
    UpdateSecurityGroupRuleDescriptionsEgress' {Maybe Bool
Maybe [SecurityGroupRuleDescription]
Maybe [IpPermission]
Maybe Text
securityGroupRuleDescriptions :: Maybe [SecurityGroupRuleDescription]
ipPermissions :: Maybe [IpPermission]
groupName :: Maybe Text
groupId :: Maybe Text
dryRun :: Maybe Bool
$sel:securityGroupRuleDescriptions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress
-> Maybe [SecurityGroupRuleDescription]
$sel:ipPermissions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe [IpPermission]
$sel:groupName:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
$sel:groupId:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
$sel:dryRun:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
groupName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [IpPermission]
ipPermissions
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions

instance
  Prelude.NFData
    UpdateSecurityGroupRuleDescriptionsEgress
  where
  rnf :: UpdateSecurityGroupRuleDescriptionsEgress -> ()
rnf UpdateSecurityGroupRuleDescriptionsEgress' {Maybe Bool
Maybe [SecurityGroupRuleDescription]
Maybe [IpPermission]
Maybe Text
securityGroupRuleDescriptions :: Maybe [SecurityGroupRuleDescription]
ipPermissions :: Maybe [IpPermission]
groupName :: Maybe Text
groupId :: Maybe Text
dryRun :: Maybe Bool
$sel:securityGroupRuleDescriptions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress
-> Maybe [SecurityGroupRuleDescription]
$sel:ipPermissions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe [IpPermission]
$sel:groupName:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
$sel:groupId:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
$sel:dryRun:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
groupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [IpPermission]
ipPermissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions

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

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

instance
  Data.ToQuery
    UpdateSecurityGroupRuleDescriptionsEgress
  where
  toQuery :: UpdateSecurityGroupRuleDescriptionsEgress -> QueryString
toQuery
    UpdateSecurityGroupRuleDescriptionsEgress' {Maybe Bool
Maybe [SecurityGroupRuleDescription]
Maybe [IpPermission]
Maybe Text
securityGroupRuleDescriptions :: Maybe [SecurityGroupRuleDescription]
ipPermissions :: Maybe [IpPermission]
groupName :: Maybe Text
groupId :: Maybe Text
dryRun :: Maybe Bool
$sel:securityGroupRuleDescriptions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress
-> Maybe [SecurityGroupRuleDescription]
$sel:ipPermissions:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe [IpPermission]
$sel:groupName:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
$sel:groupId:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Text
$sel:dryRun:UpdateSecurityGroupRuleDescriptionsEgress' :: UpdateSecurityGroupRuleDescriptionsEgress -> Maybe Bool
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"Action"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"UpdateSecurityGroupRuleDescriptionsEgress" ::
                        Prelude.ByteString
                    ),
          ByteString
"Version"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
          ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
          ByteString
"GroupId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
groupId,
          ByteString
"GroupName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
groupName,
          forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"IpPermissions"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IpPermission]
ipPermissions
            ),
          forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SecurityGroupRuleDescription"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SecurityGroupRuleDescription]
securityGroupRuleDescriptions
            )
        ]

-- | /See:/ 'newUpdateSecurityGroupRuleDescriptionsEgressResponse' smart constructor.
data UpdateSecurityGroupRuleDescriptionsEgressResponse = UpdateSecurityGroupRuleDescriptionsEgressResponse'
  { -- | Returns @true@ if the request succeeds; otherwise, returns an error.
    UpdateSecurityGroupRuleDescriptionsEgressResponse -> Maybe Bool
return' :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    UpdateSecurityGroupRuleDescriptionsEgressResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateSecurityGroupRuleDescriptionsEgressResponse
-> UpdateSecurityGroupRuleDescriptionsEgressResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSecurityGroupRuleDescriptionsEgressResponse
-> UpdateSecurityGroupRuleDescriptionsEgressResponse -> Bool
$c/= :: UpdateSecurityGroupRuleDescriptionsEgressResponse
-> UpdateSecurityGroupRuleDescriptionsEgressResponse -> Bool
== :: UpdateSecurityGroupRuleDescriptionsEgressResponse
-> UpdateSecurityGroupRuleDescriptionsEgressResponse -> Bool
$c== :: UpdateSecurityGroupRuleDescriptionsEgressResponse
-> UpdateSecurityGroupRuleDescriptionsEgressResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSecurityGroupRuleDescriptionsEgressResponse]
ReadPrec UpdateSecurityGroupRuleDescriptionsEgressResponse
Int -> ReadS UpdateSecurityGroupRuleDescriptionsEgressResponse
ReadS [UpdateSecurityGroupRuleDescriptionsEgressResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSecurityGroupRuleDescriptionsEgressResponse]
$creadListPrec :: ReadPrec [UpdateSecurityGroupRuleDescriptionsEgressResponse]
readPrec :: ReadPrec UpdateSecurityGroupRuleDescriptionsEgressResponse
$creadPrec :: ReadPrec UpdateSecurityGroupRuleDescriptionsEgressResponse
readList :: ReadS [UpdateSecurityGroupRuleDescriptionsEgressResponse]
$creadList :: ReadS [UpdateSecurityGroupRuleDescriptionsEgressResponse]
readsPrec :: Int -> ReadS UpdateSecurityGroupRuleDescriptionsEgressResponse
$creadsPrec :: Int -> ReadS UpdateSecurityGroupRuleDescriptionsEgressResponse
Prelude.Read, Int -> UpdateSecurityGroupRuleDescriptionsEgressResponse -> ShowS
[UpdateSecurityGroupRuleDescriptionsEgressResponse] -> ShowS
UpdateSecurityGroupRuleDescriptionsEgressResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSecurityGroupRuleDescriptionsEgressResponse] -> ShowS
$cshowList :: [UpdateSecurityGroupRuleDescriptionsEgressResponse] -> ShowS
show :: UpdateSecurityGroupRuleDescriptionsEgressResponse -> String
$cshow :: UpdateSecurityGroupRuleDescriptionsEgressResponse -> String
showsPrec :: Int -> UpdateSecurityGroupRuleDescriptionsEgressResponse -> ShowS
$cshowsPrec :: Int -> UpdateSecurityGroupRuleDescriptionsEgressResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateSecurityGroupRuleDescriptionsEgressResponse x
-> UpdateSecurityGroupRuleDescriptionsEgressResponse
forall x.
UpdateSecurityGroupRuleDescriptionsEgressResponse
-> Rep UpdateSecurityGroupRuleDescriptionsEgressResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSecurityGroupRuleDescriptionsEgressResponse x
-> UpdateSecurityGroupRuleDescriptionsEgressResponse
$cfrom :: forall x.
UpdateSecurityGroupRuleDescriptionsEgressResponse
-> Rep UpdateSecurityGroupRuleDescriptionsEgressResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateSecurityGroupRuleDescriptionsEgressResponse' 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:
--
-- 'return'', 'updateSecurityGroupRuleDescriptionsEgressResponse_return' - Returns @true@ if the request succeeds; otherwise, returns an error.
--
-- 'httpStatus', 'updateSecurityGroupRuleDescriptionsEgressResponse_httpStatus' - The response's http status code.
newUpdateSecurityGroupRuleDescriptionsEgressResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSecurityGroupRuleDescriptionsEgressResponse
newUpdateSecurityGroupRuleDescriptionsEgressResponse :: Int -> UpdateSecurityGroupRuleDescriptionsEgressResponse
newUpdateSecurityGroupRuleDescriptionsEgressResponse
  Int
pHttpStatus_ =
    UpdateSecurityGroupRuleDescriptionsEgressResponse'
      { $sel:return':UpdateSecurityGroupRuleDescriptionsEgressResponse' :: Maybe Bool
return' =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateSecurityGroupRuleDescriptionsEgressResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Returns @true@ if the request succeeds; otherwise, returns an error.
updateSecurityGroupRuleDescriptionsEgressResponse_return :: Lens.Lens' UpdateSecurityGroupRuleDescriptionsEgressResponse (Prelude.Maybe Prelude.Bool)
updateSecurityGroupRuleDescriptionsEgressResponse_return :: Lens'
  UpdateSecurityGroupRuleDescriptionsEgressResponse (Maybe Bool)
updateSecurityGroupRuleDescriptionsEgressResponse_return = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSecurityGroupRuleDescriptionsEgressResponse' {Maybe Bool
return' :: Maybe Bool
$sel:return':UpdateSecurityGroupRuleDescriptionsEgressResponse' :: UpdateSecurityGroupRuleDescriptionsEgressResponse -> Maybe Bool
return'} -> Maybe Bool
return') (\s :: UpdateSecurityGroupRuleDescriptionsEgressResponse
s@UpdateSecurityGroupRuleDescriptionsEgressResponse' {} Maybe Bool
a -> UpdateSecurityGroupRuleDescriptionsEgressResponse
s {$sel:return':UpdateSecurityGroupRuleDescriptionsEgressResponse' :: Maybe Bool
return' = Maybe Bool
a} :: UpdateSecurityGroupRuleDescriptionsEgressResponse)

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

instance
  Prelude.NFData
    UpdateSecurityGroupRuleDescriptionsEgressResponse
  where
  rnf :: UpdateSecurityGroupRuleDescriptionsEgressResponse -> ()
rnf
    UpdateSecurityGroupRuleDescriptionsEgressResponse' {Int
Maybe Bool
httpStatus :: Int
return' :: Maybe Bool
$sel:httpStatus:UpdateSecurityGroupRuleDescriptionsEgressResponse' :: UpdateSecurityGroupRuleDescriptionsEgressResponse -> Int
$sel:return':UpdateSecurityGroupRuleDescriptionsEgressResponse' :: UpdateSecurityGroupRuleDescriptionsEgressResponse -> Maybe Bool
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
return'
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus