{-# 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.ElastiCache.AuthorizeCacheSecurityGroupIngress
-- 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)
--
-- Allows network ingress to a cache security group. Applications using
-- ElastiCache must be running on Amazon EC2, and Amazon EC2 security
-- groups are used as the authorization mechanism.
--
-- You cannot authorize ingress from an Amazon EC2 security group in one
-- region to an ElastiCache cluster in another region.
module Amazonka.ElastiCache.AuthorizeCacheSecurityGroupIngress
  ( -- * Creating a Request
    AuthorizeCacheSecurityGroupIngress (..),
    newAuthorizeCacheSecurityGroupIngress,

    -- * Request Lenses
    authorizeCacheSecurityGroupIngress_cacheSecurityGroupName,
    authorizeCacheSecurityGroupIngress_eC2SecurityGroupName,
    authorizeCacheSecurityGroupIngress_eC2SecurityGroupOwnerId,

    -- * Destructuring the Response
    AuthorizeCacheSecurityGroupIngressResponse (..),
    newAuthorizeCacheSecurityGroupIngressResponse,

    -- * Response Lenses
    authorizeCacheSecurityGroupIngressResponse_cacheSecurityGroup,
    authorizeCacheSecurityGroupIngressResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.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

-- | Represents the input of an AuthorizeCacheSecurityGroupIngress operation.
--
-- /See:/ 'newAuthorizeCacheSecurityGroupIngress' smart constructor.
data AuthorizeCacheSecurityGroupIngress = AuthorizeCacheSecurityGroupIngress'
  { -- | The cache security group that allows network ingress.
    AuthorizeCacheSecurityGroupIngress -> Text
cacheSecurityGroupName :: Prelude.Text,
    -- | The Amazon EC2 security group to be authorized for ingress to the cache
    -- security group.
    AuthorizeCacheSecurityGroupIngress -> Text
eC2SecurityGroupName :: Prelude.Text,
    -- | The Amazon account number of the Amazon EC2 security group owner. Note
    -- that this is not the same thing as an Amazon access key ID - you must
    -- provide a valid Amazon account number for this parameter.
    AuthorizeCacheSecurityGroupIngress -> Text
eC2SecurityGroupOwnerId :: Prelude.Text
  }
  deriving (AuthorizeCacheSecurityGroupIngress
-> AuthorizeCacheSecurityGroupIngress -> Bool
(AuthorizeCacheSecurityGroupIngress
 -> AuthorizeCacheSecurityGroupIngress -> Bool)
-> (AuthorizeCacheSecurityGroupIngress
    -> AuthorizeCacheSecurityGroupIngress -> Bool)
-> Eq AuthorizeCacheSecurityGroupIngress
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthorizeCacheSecurityGroupIngress
-> AuthorizeCacheSecurityGroupIngress -> Bool
$c/= :: AuthorizeCacheSecurityGroupIngress
-> AuthorizeCacheSecurityGroupIngress -> Bool
== :: AuthorizeCacheSecurityGroupIngress
-> AuthorizeCacheSecurityGroupIngress -> Bool
$c== :: AuthorizeCacheSecurityGroupIngress
-> AuthorizeCacheSecurityGroupIngress -> Bool
Prelude.Eq, ReadPrec [AuthorizeCacheSecurityGroupIngress]
ReadPrec AuthorizeCacheSecurityGroupIngress
Int -> ReadS AuthorizeCacheSecurityGroupIngress
ReadS [AuthorizeCacheSecurityGroupIngress]
(Int -> ReadS AuthorizeCacheSecurityGroupIngress)
-> ReadS [AuthorizeCacheSecurityGroupIngress]
-> ReadPrec AuthorizeCacheSecurityGroupIngress
-> ReadPrec [AuthorizeCacheSecurityGroupIngress]
-> Read AuthorizeCacheSecurityGroupIngress
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthorizeCacheSecurityGroupIngress]
$creadListPrec :: ReadPrec [AuthorizeCacheSecurityGroupIngress]
readPrec :: ReadPrec AuthorizeCacheSecurityGroupIngress
$creadPrec :: ReadPrec AuthorizeCacheSecurityGroupIngress
readList :: ReadS [AuthorizeCacheSecurityGroupIngress]
$creadList :: ReadS [AuthorizeCacheSecurityGroupIngress]
readsPrec :: Int -> ReadS AuthorizeCacheSecurityGroupIngress
$creadsPrec :: Int -> ReadS AuthorizeCacheSecurityGroupIngress
Prelude.Read, Int -> AuthorizeCacheSecurityGroupIngress -> ShowS
[AuthorizeCacheSecurityGroupIngress] -> ShowS
AuthorizeCacheSecurityGroupIngress -> String
(Int -> AuthorizeCacheSecurityGroupIngress -> ShowS)
-> (AuthorizeCacheSecurityGroupIngress -> String)
-> ([AuthorizeCacheSecurityGroupIngress] -> ShowS)
-> Show AuthorizeCacheSecurityGroupIngress
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthorizeCacheSecurityGroupIngress] -> ShowS
$cshowList :: [AuthorizeCacheSecurityGroupIngress] -> ShowS
show :: AuthorizeCacheSecurityGroupIngress -> String
$cshow :: AuthorizeCacheSecurityGroupIngress -> String
showsPrec :: Int -> AuthorizeCacheSecurityGroupIngress -> ShowS
$cshowsPrec :: Int -> AuthorizeCacheSecurityGroupIngress -> ShowS
Prelude.Show, (forall x.
 AuthorizeCacheSecurityGroupIngress
 -> Rep AuthorizeCacheSecurityGroupIngress x)
-> (forall x.
    Rep AuthorizeCacheSecurityGroupIngress x
    -> AuthorizeCacheSecurityGroupIngress)
-> Generic AuthorizeCacheSecurityGroupIngress
forall x.
Rep AuthorizeCacheSecurityGroupIngress x
-> AuthorizeCacheSecurityGroupIngress
forall x.
AuthorizeCacheSecurityGroupIngress
-> Rep AuthorizeCacheSecurityGroupIngress x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AuthorizeCacheSecurityGroupIngress x
-> AuthorizeCacheSecurityGroupIngress
$cfrom :: forall x.
AuthorizeCacheSecurityGroupIngress
-> Rep AuthorizeCacheSecurityGroupIngress x
Prelude.Generic)

-- |
-- Create a value of 'AuthorizeCacheSecurityGroupIngress' 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:
--
-- 'cacheSecurityGroupName', 'authorizeCacheSecurityGroupIngress_cacheSecurityGroupName' - The cache security group that allows network ingress.
--
-- 'eC2SecurityGroupName', 'authorizeCacheSecurityGroupIngress_eC2SecurityGroupName' - The Amazon EC2 security group to be authorized for ingress to the cache
-- security group.
--
-- 'eC2SecurityGroupOwnerId', 'authorizeCacheSecurityGroupIngress_eC2SecurityGroupOwnerId' - The Amazon account number of the Amazon EC2 security group owner. Note
-- that this is not the same thing as an Amazon access key ID - you must
-- provide a valid Amazon account number for this parameter.
newAuthorizeCacheSecurityGroupIngress ::
  -- | 'cacheSecurityGroupName'
  Prelude.Text ->
  -- | 'eC2SecurityGroupName'
  Prelude.Text ->
  -- | 'eC2SecurityGroupOwnerId'
  Prelude.Text ->
  AuthorizeCacheSecurityGroupIngress
newAuthorizeCacheSecurityGroupIngress :: Text -> Text -> Text -> AuthorizeCacheSecurityGroupIngress
newAuthorizeCacheSecurityGroupIngress
  Text
pCacheSecurityGroupName_
  Text
pEC2SecurityGroupName_
  Text
pEC2SecurityGroupOwnerId_ =
    AuthorizeCacheSecurityGroupIngress' :: Text -> Text -> Text -> AuthorizeCacheSecurityGroupIngress
AuthorizeCacheSecurityGroupIngress'
      { $sel:cacheSecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: Text
cacheSecurityGroupName =
          Text
pCacheSecurityGroupName_,
        $sel:eC2SecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: Text
eC2SecurityGroupName =
          Text
pEC2SecurityGroupName_,
        $sel:eC2SecurityGroupOwnerId:AuthorizeCacheSecurityGroupIngress' :: Text
eC2SecurityGroupOwnerId =
          Text
pEC2SecurityGroupOwnerId_
      }

-- | The cache security group that allows network ingress.
authorizeCacheSecurityGroupIngress_cacheSecurityGroupName :: Lens.Lens' AuthorizeCacheSecurityGroupIngress Prelude.Text
authorizeCacheSecurityGroupIngress_cacheSecurityGroupName :: (Text -> f Text)
-> AuthorizeCacheSecurityGroupIngress
-> f AuthorizeCacheSecurityGroupIngress
authorizeCacheSecurityGroupIngress_cacheSecurityGroupName = (AuthorizeCacheSecurityGroupIngress -> Text)
-> (AuthorizeCacheSecurityGroupIngress
    -> Text -> AuthorizeCacheSecurityGroupIngress)
-> Lens
     AuthorizeCacheSecurityGroupIngress
     AuthorizeCacheSecurityGroupIngress
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizeCacheSecurityGroupIngress' {Text
cacheSecurityGroupName :: Text
$sel:cacheSecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: AuthorizeCacheSecurityGroupIngress -> Text
cacheSecurityGroupName} -> Text
cacheSecurityGroupName) (\s :: AuthorizeCacheSecurityGroupIngress
s@AuthorizeCacheSecurityGroupIngress' {} Text
a -> AuthorizeCacheSecurityGroupIngress
s {$sel:cacheSecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: Text
cacheSecurityGroupName = Text
a} :: AuthorizeCacheSecurityGroupIngress)

-- | The Amazon EC2 security group to be authorized for ingress to the cache
-- security group.
authorizeCacheSecurityGroupIngress_eC2SecurityGroupName :: Lens.Lens' AuthorizeCacheSecurityGroupIngress Prelude.Text
authorizeCacheSecurityGroupIngress_eC2SecurityGroupName :: (Text -> f Text)
-> AuthorizeCacheSecurityGroupIngress
-> f AuthorizeCacheSecurityGroupIngress
authorizeCacheSecurityGroupIngress_eC2SecurityGroupName = (AuthorizeCacheSecurityGroupIngress -> Text)
-> (AuthorizeCacheSecurityGroupIngress
    -> Text -> AuthorizeCacheSecurityGroupIngress)
-> Lens
     AuthorizeCacheSecurityGroupIngress
     AuthorizeCacheSecurityGroupIngress
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizeCacheSecurityGroupIngress' {Text
eC2SecurityGroupName :: Text
$sel:eC2SecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: AuthorizeCacheSecurityGroupIngress -> Text
eC2SecurityGroupName} -> Text
eC2SecurityGroupName) (\s :: AuthorizeCacheSecurityGroupIngress
s@AuthorizeCacheSecurityGroupIngress' {} Text
a -> AuthorizeCacheSecurityGroupIngress
s {$sel:eC2SecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: Text
eC2SecurityGroupName = Text
a} :: AuthorizeCacheSecurityGroupIngress)

-- | The Amazon account number of the Amazon EC2 security group owner. Note
-- that this is not the same thing as an Amazon access key ID - you must
-- provide a valid Amazon account number for this parameter.
authorizeCacheSecurityGroupIngress_eC2SecurityGroupOwnerId :: Lens.Lens' AuthorizeCacheSecurityGroupIngress Prelude.Text
authorizeCacheSecurityGroupIngress_eC2SecurityGroupOwnerId :: (Text -> f Text)
-> AuthorizeCacheSecurityGroupIngress
-> f AuthorizeCacheSecurityGroupIngress
authorizeCacheSecurityGroupIngress_eC2SecurityGroupOwnerId = (AuthorizeCacheSecurityGroupIngress -> Text)
-> (AuthorizeCacheSecurityGroupIngress
    -> Text -> AuthorizeCacheSecurityGroupIngress)
-> Lens
     AuthorizeCacheSecurityGroupIngress
     AuthorizeCacheSecurityGroupIngress
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizeCacheSecurityGroupIngress' {Text
eC2SecurityGroupOwnerId :: Text
$sel:eC2SecurityGroupOwnerId:AuthorizeCacheSecurityGroupIngress' :: AuthorizeCacheSecurityGroupIngress -> Text
eC2SecurityGroupOwnerId} -> Text
eC2SecurityGroupOwnerId) (\s :: AuthorizeCacheSecurityGroupIngress
s@AuthorizeCacheSecurityGroupIngress' {} Text
a -> AuthorizeCacheSecurityGroupIngress
s {$sel:eC2SecurityGroupOwnerId:AuthorizeCacheSecurityGroupIngress' :: Text
eC2SecurityGroupOwnerId = Text
a} :: AuthorizeCacheSecurityGroupIngress)

instance
  Core.AWSRequest
    AuthorizeCacheSecurityGroupIngress
  where
  type
    AWSResponse AuthorizeCacheSecurityGroupIngress =
      AuthorizeCacheSecurityGroupIngressResponse
  request :: AuthorizeCacheSecurityGroupIngress
-> Request AuthorizeCacheSecurityGroupIngress
request = Service
-> AuthorizeCacheSecurityGroupIngress
-> Request AuthorizeCacheSecurityGroupIngress
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy AuthorizeCacheSecurityGroupIngress
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AuthorizeCacheSecurityGroupIngress)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse AuthorizeCacheSecurityGroupIngress))
-> Logger
-> Service
-> Proxy AuthorizeCacheSecurityGroupIngress
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse AuthorizeCacheSecurityGroupIngress)))
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
"AuthorizeCacheSecurityGroupIngressResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe CacheSecurityGroup
-> Int -> AuthorizeCacheSecurityGroupIngressResponse
AuthorizeCacheSecurityGroupIngressResponse'
            (Maybe CacheSecurityGroup
 -> Int -> AuthorizeCacheSecurityGroupIngressResponse)
-> Either String (Maybe CacheSecurityGroup)
-> Either
     String (Int -> AuthorizeCacheSecurityGroupIngressResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe CacheSecurityGroup)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CacheSecurityGroup")
              Either String (Int -> AuthorizeCacheSecurityGroupIngressResponse)
-> Either String Int
-> Either String AuthorizeCacheSecurityGroupIngressResponse
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
    AuthorizeCacheSecurityGroupIngress

instance
  Prelude.NFData
    AuthorizeCacheSecurityGroupIngress

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

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

instance
  Core.ToQuery
    AuthorizeCacheSecurityGroupIngress
  where
  toQuery :: AuthorizeCacheSecurityGroupIngress -> QueryString
toQuery AuthorizeCacheSecurityGroupIngress' {Text
eC2SecurityGroupOwnerId :: Text
eC2SecurityGroupName :: Text
cacheSecurityGroupName :: Text
$sel:eC2SecurityGroupOwnerId:AuthorizeCacheSecurityGroupIngress' :: AuthorizeCacheSecurityGroupIngress -> Text
$sel:eC2SecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: AuthorizeCacheSecurityGroupIngress -> Text
$sel:cacheSecurityGroupName:AuthorizeCacheSecurityGroupIngress' :: AuthorizeCacheSecurityGroupIngress -> 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
"AuthorizeCacheSecurityGroupIngress" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"CacheSecurityGroupName"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
cacheSecurityGroupName,
        ByteString
"EC2SecurityGroupName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
eC2SecurityGroupName,
        ByteString
"EC2SecurityGroupOwnerId"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
eC2SecurityGroupOwnerId
      ]

-- | /See:/ 'newAuthorizeCacheSecurityGroupIngressResponse' smart constructor.
data AuthorizeCacheSecurityGroupIngressResponse = AuthorizeCacheSecurityGroupIngressResponse'
  { AuthorizeCacheSecurityGroupIngressResponse
-> Maybe CacheSecurityGroup
cacheSecurityGroup :: Prelude.Maybe CacheSecurityGroup,
    -- | The response's http status code.
    AuthorizeCacheSecurityGroupIngressResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (AuthorizeCacheSecurityGroupIngressResponse
-> AuthorizeCacheSecurityGroupIngressResponse -> Bool
(AuthorizeCacheSecurityGroupIngressResponse
 -> AuthorizeCacheSecurityGroupIngressResponse -> Bool)
-> (AuthorizeCacheSecurityGroupIngressResponse
    -> AuthorizeCacheSecurityGroupIngressResponse -> Bool)
-> Eq AuthorizeCacheSecurityGroupIngressResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthorizeCacheSecurityGroupIngressResponse
-> AuthorizeCacheSecurityGroupIngressResponse -> Bool
$c/= :: AuthorizeCacheSecurityGroupIngressResponse
-> AuthorizeCacheSecurityGroupIngressResponse -> Bool
== :: AuthorizeCacheSecurityGroupIngressResponse
-> AuthorizeCacheSecurityGroupIngressResponse -> Bool
$c== :: AuthorizeCacheSecurityGroupIngressResponse
-> AuthorizeCacheSecurityGroupIngressResponse -> Bool
Prelude.Eq, ReadPrec [AuthorizeCacheSecurityGroupIngressResponse]
ReadPrec AuthorizeCacheSecurityGroupIngressResponse
Int -> ReadS AuthorizeCacheSecurityGroupIngressResponse
ReadS [AuthorizeCacheSecurityGroupIngressResponse]
(Int -> ReadS AuthorizeCacheSecurityGroupIngressResponse)
-> ReadS [AuthorizeCacheSecurityGroupIngressResponse]
-> ReadPrec AuthorizeCacheSecurityGroupIngressResponse
-> ReadPrec [AuthorizeCacheSecurityGroupIngressResponse]
-> Read AuthorizeCacheSecurityGroupIngressResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthorizeCacheSecurityGroupIngressResponse]
$creadListPrec :: ReadPrec [AuthorizeCacheSecurityGroupIngressResponse]
readPrec :: ReadPrec AuthorizeCacheSecurityGroupIngressResponse
$creadPrec :: ReadPrec AuthorizeCacheSecurityGroupIngressResponse
readList :: ReadS [AuthorizeCacheSecurityGroupIngressResponse]
$creadList :: ReadS [AuthorizeCacheSecurityGroupIngressResponse]
readsPrec :: Int -> ReadS AuthorizeCacheSecurityGroupIngressResponse
$creadsPrec :: Int -> ReadS AuthorizeCacheSecurityGroupIngressResponse
Prelude.Read, Int -> AuthorizeCacheSecurityGroupIngressResponse -> ShowS
[AuthorizeCacheSecurityGroupIngressResponse] -> ShowS
AuthorizeCacheSecurityGroupIngressResponse -> String
(Int -> AuthorizeCacheSecurityGroupIngressResponse -> ShowS)
-> (AuthorizeCacheSecurityGroupIngressResponse -> String)
-> ([AuthorizeCacheSecurityGroupIngressResponse] -> ShowS)
-> Show AuthorizeCacheSecurityGroupIngressResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthorizeCacheSecurityGroupIngressResponse] -> ShowS
$cshowList :: [AuthorizeCacheSecurityGroupIngressResponse] -> ShowS
show :: AuthorizeCacheSecurityGroupIngressResponse -> String
$cshow :: AuthorizeCacheSecurityGroupIngressResponse -> String
showsPrec :: Int -> AuthorizeCacheSecurityGroupIngressResponse -> ShowS
$cshowsPrec :: Int -> AuthorizeCacheSecurityGroupIngressResponse -> ShowS
Prelude.Show, (forall x.
 AuthorizeCacheSecurityGroupIngressResponse
 -> Rep AuthorizeCacheSecurityGroupIngressResponse x)
-> (forall x.
    Rep AuthorizeCacheSecurityGroupIngressResponse x
    -> AuthorizeCacheSecurityGroupIngressResponse)
-> Generic AuthorizeCacheSecurityGroupIngressResponse
forall x.
Rep AuthorizeCacheSecurityGroupIngressResponse x
-> AuthorizeCacheSecurityGroupIngressResponse
forall x.
AuthorizeCacheSecurityGroupIngressResponse
-> Rep AuthorizeCacheSecurityGroupIngressResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AuthorizeCacheSecurityGroupIngressResponse x
-> AuthorizeCacheSecurityGroupIngressResponse
$cfrom :: forall x.
AuthorizeCacheSecurityGroupIngressResponse
-> Rep AuthorizeCacheSecurityGroupIngressResponse x
Prelude.Generic)

-- |
-- Create a value of 'AuthorizeCacheSecurityGroupIngressResponse' 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:
--
-- 'cacheSecurityGroup', 'authorizeCacheSecurityGroupIngressResponse_cacheSecurityGroup' - Undocumented member.
--
-- 'httpStatus', 'authorizeCacheSecurityGroupIngressResponse_httpStatus' - The response's http status code.
newAuthorizeCacheSecurityGroupIngressResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  AuthorizeCacheSecurityGroupIngressResponse
newAuthorizeCacheSecurityGroupIngressResponse :: Int -> AuthorizeCacheSecurityGroupIngressResponse
newAuthorizeCacheSecurityGroupIngressResponse
  Int
pHttpStatus_ =
    AuthorizeCacheSecurityGroupIngressResponse' :: Maybe CacheSecurityGroup
-> Int -> AuthorizeCacheSecurityGroupIngressResponse
AuthorizeCacheSecurityGroupIngressResponse'
      { $sel:cacheSecurityGroup:AuthorizeCacheSecurityGroupIngressResponse' :: Maybe CacheSecurityGroup
cacheSecurityGroup =
          Maybe CacheSecurityGroup
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:AuthorizeCacheSecurityGroupIngressResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
authorizeCacheSecurityGroupIngressResponse_cacheSecurityGroup :: Lens.Lens' AuthorizeCacheSecurityGroupIngressResponse (Prelude.Maybe CacheSecurityGroup)
authorizeCacheSecurityGroupIngressResponse_cacheSecurityGroup :: (Maybe CacheSecurityGroup -> f (Maybe CacheSecurityGroup))
-> AuthorizeCacheSecurityGroupIngressResponse
-> f AuthorizeCacheSecurityGroupIngressResponse
authorizeCacheSecurityGroupIngressResponse_cacheSecurityGroup = (AuthorizeCacheSecurityGroupIngressResponse
 -> Maybe CacheSecurityGroup)
-> (AuthorizeCacheSecurityGroupIngressResponse
    -> Maybe CacheSecurityGroup
    -> AuthorizeCacheSecurityGroupIngressResponse)
-> Lens
     AuthorizeCacheSecurityGroupIngressResponse
     AuthorizeCacheSecurityGroupIngressResponse
     (Maybe CacheSecurityGroup)
     (Maybe CacheSecurityGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthorizeCacheSecurityGroupIngressResponse' {Maybe CacheSecurityGroup
cacheSecurityGroup :: Maybe CacheSecurityGroup
$sel:cacheSecurityGroup:AuthorizeCacheSecurityGroupIngressResponse' :: AuthorizeCacheSecurityGroupIngressResponse
-> Maybe CacheSecurityGroup
cacheSecurityGroup} -> Maybe CacheSecurityGroup
cacheSecurityGroup) (\s :: AuthorizeCacheSecurityGroupIngressResponse
s@AuthorizeCacheSecurityGroupIngressResponse' {} Maybe CacheSecurityGroup
a -> AuthorizeCacheSecurityGroupIngressResponse
s {$sel:cacheSecurityGroup:AuthorizeCacheSecurityGroupIngressResponse' :: Maybe CacheSecurityGroup
cacheSecurityGroup = Maybe CacheSecurityGroup
a} :: AuthorizeCacheSecurityGroupIngressResponse)

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

instance
  Prelude.NFData
    AuthorizeCacheSecurityGroupIngressResponse