{-# 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.Redshift.DescribeClusterSecurityGroups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns information about Amazon Redshift security groups. If the name
-- of a security group is specified, the response will contain only
-- information about only that security group.
--
-- For information about managing security groups, go to
-- <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html Amazon Redshift Cluster Security Groups>
-- in the /Amazon Redshift Cluster Management Guide/.
--
-- If you specify both tag keys and tag values in the same request, Amazon
-- Redshift returns all security groups that match any combination of the
-- specified keys and values. For example, if you have @owner@ and
-- @environment@ for tag keys, and @admin@ and @test@ for tag values, all
-- security groups that have any combination of those values are returned.
--
-- If both tag keys and values are omitted from the request, security
-- groups are returned regardless of whether they have tag keys or values
-- associated with them.
--
-- This operation returns paginated results.
module Amazonka.Redshift.DescribeClusterSecurityGroups
  ( -- * Creating a Request
    DescribeClusterSecurityGroups (..),
    newDescribeClusterSecurityGroups,

    -- * Request Lenses
    describeClusterSecurityGroups_clusterSecurityGroupName,
    describeClusterSecurityGroups_marker,
    describeClusterSecurityGroups_maxRecords,
    describeClusterSecurityGroups_tagKeys,
    describeClusterSecurityGroups_tagValues,

    -- * Destructuring the Response
    DescribeClusterSecurityGroupsResponse (..),
    newDescribeClusterSecurityGroupsResponse,

    -- * Response Lenses
    describeClusterSecurityGroupsResponse_clusterSecurityGroups,
    describeClusterSecurityGroupsResponse_marker,
    describeClusterSecurityGroupsResponse_httpStatus,
  )
where

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 Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newDescribeClusterSecurityGroups' smart constructor.
data DescribeClusterSecurityGroups = DescribeClusterSecurityGroups'
  { -- | The name of a cluster security group for which you are requesting
    -- details. You can specify either the __Marker__ parameter or a
    -- __ClusterSecurityGroupName__ parameter, but not both.
    --
    -- Example: @securitygroup1@
    DescribeClusterSecurityGroups -> Maybe Text
clusterSecurityGroupName :: Prelude.Maybe Prelude.Text,
    -- | An optional parameter that specifies the starting point to return a set
    -- of response records. When the results of a DescribeClusterSecurityGroups
    -- request exceed the value specified in @MaxRecords@, Amazon Web Services
    -- returns a value in the @Marker@ field of the response. You can retrieve
    -- the next set of response records by providing the returned marker value
    -- in the @Marker@ parameter and retrying the request.
    --
    -- Constraints: You can specify either the __ClusterSecurityGroupName__
    -- parameter or the __Marker__ parameter, but not both.
    DescribeClusterSecurityGroups -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of response records to return in each call. If the
    -- number of remaining response records exceeds the specified @MaxRecords@
    -- value, a value is returned in a @marker@ field of the response. You can
    -- retrieve the next set of records by retrying the command with the
    -- returned marker value.
    --
    -- Default: @100@
    --
    -- Constraints: minimum 20, maximum 100.
    DescribeClusterSecurityGroups -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int,
    -- | A tag key or keys for which you want to return all matching cluster
    -- security groups that are associated with the specified key or keys. For
    -- example, suppose that you have security groups that are tagged with keys
    -- called @owner@ and @environment@. If you specify both of these tag keys
    -- in the request, Amazon Redshift returns a response with the security
    -- groups that have either or both of these tag keys associated with them.
    DescribeClusterSecurityGroups -> Maybe [Text]
tagKeys :: Prelude.Maybe [Prelude.Text],
    -- | A tag value or values for which you want to return all matching cluster
    -- security groups that are associated with the specified tag value or
    -- values. For example, suppose that you have security groups that are
    -- tagged with values called @admin@ and @test@. If you specify both of
    -- these tag values in the request, Amazon Redshift returns a response with
    -- the security groups that have either or both of these tag values
    -- associated with them.
    DescribeClusterSecurityGroups -> Maybe [Text]
tagValues :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeClusterSecurityGroups
-> DescribeClusterSecurityGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusterSecurityGroups
-> DescribeClusterSecurityGroups -> Bool
$c/= :: DescribeClusterSecurityGroups
-> DescribeClusterSecurityGroups -> Bool
== :: DescribeClusterSecurityGroups
-> DescribeClusterSecurityGroups -> Bool
$c== :: DescribeClusterSecurityGroups
-> DescribeClusterSecurityGroups -> Bool
Prelude.Eq, ReadPrec [DescribeClusterSecurityGroups]
ReadPrec DescribeClusterSecurityGroups
Int -> ReadS DescribeClusterSecurityGroups
ReadS [DescribeClusterSecurityGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusterSecurityGroups]
$creadListPrec :: ReadPrec [DescribeClusterSecurityGroups]
readPrec :: ReadPrec DescribeClusterSecurityGroups
$creadPrec :: ReadPrec DescribeClusterSecurityGroups
readList :: ReadS [DescribeClusterSecurityGroups]
$creadList :: ReadS [DescribeClusterSecurityGroups]
readsPrec :: Int -> ReadS DescribeClusterSecurityGroups
$creadsPrec :: Int -> ReadS DescribeClusterSecurityGroups
Prelude.Read, Int -> DescribeClusterSecurityGroups -> ShowS
[DescribeClusterSecurityGroups] -> ShowS
DescribeClusterSecurityGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusterSecurityGroups] -> ShowS
$cshowList :: [DescribeClusterSecurityGroups] -> ShowS
show :: DescribeClusterSecurityGroups -> String
$cshow :: DescribeClusterSecurityGroups -> String
showsPrec :: Int -> DescribeClusterSecurityGroups -> ShowS
$cshowsPrec :: Int -> DescribeClusterSecurityGroups -> ShowS
Prelude.Show, forall x.
Rep DescribeClusterSecurityGroups x
-> DescribeClusterSecurityGroups
forall x.
DescribeClusterSecurityGroups
-> Rep DescribeClusterSecurityGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClusterSecurityGroups x
-> DescribeClusterSecurityGroups
$cfrom :: forall x.
DescribeClusterSecurityGroups
-> Rep DescribeClusterSecurityGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusterSecurityGroups' 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:
--
-- 'clusterSecurityGroupName', 'describeClusterSecurityGroups_clusterSecurityGroupName' - The name of a cluster security group for which you are requesting
-- details. You can specify either the __Marker__ parameter or a
-- __ClusterSecurityGroupName__ parameter, but not both.
--
-- Example: @securitygroup1@
--
-- 'marker', 'describeClusterSecurityGroups_marker' - An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeClusterSecurityGroups
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- Constraints: You can specify either the __ClusterSecurityGroupName__
-- parameter or the __Marker__ parameter, but not both.
--
-- 'maxRecords', 'describeClusterSecurityGroups_maxRecords' - The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
--
-- 'tagKeys', 'describeClusterSecurityGroups_tagKeys' - A tag key or keys for which you want to return all matching cluster
-- security groups that are associated with the specified key or keys. For
-- example, suppose that you have security groups that are tagged with keys
-- called @owner@ and @environment@. If you specify both of these tag keys
-- in the request, Amazon Redshift returns a response with the security
-- groups that have either or both of these tag keys associated with them.
--
-- 'tagValues', 'describeClusterSecurityGroups_tagValues' - A tag value or values for which you want to return all matching cluster
-- security groups that are associated with the specified tag value or
-- values. For example, suppose that you have security groups that are
-- tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the security groups that have either or both of these tag values
-- associated with them.
newDescribeClusterSecurityGroups ::
  DescribeClusterSecurityGroups
newDescribeClusterSecurityGroups :: DescribeClusterSecurityGroups
newDescribeClusterSecurityGroups =
  DescribeClusterSecurityGroups'
    { $sel:clusterSecurityGroupName:DescribeClusterSecurityGroups' :: Maybe Text
clusterSecurityGroupName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterSecurityGroups' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeClusterSecurityGroups' :: Maybe Int
maxRecords = forall a. Maybe a
Prelude.Nothing,
      $sel:tagKeys:DescribeClusterSecurityGroups' :: Maybe [Text]
tagKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tagValues:DescribeClusterSecurityGroups' :: Maybe [Text]
tagValues = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of a cluster security group for which you are requesting
-- details. You can specify either the __Marker__ parameter or a
-- __ClusterSecurityGroupName__ parameter, but not both.
--
-- Example: @securitygroup1@
describeClusterSecurityGroups_clusterSecurityGroupName :: Lens.Lens' DescribeClusterSecurityGroups (Prelude.Maybe Prelude.Text)
describeClusterSecurityGroups_clusterSecurityGroupName :: Lens' DescribeClusterSecurityGroups (Maybe Text)
describeClusterSecurityGroups_clusterSecurityGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroups' {Maybe Text
clusterSecurityGroupName :: Maybe Text
$sel:clusterSecurityGroupName:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
clusterSecurityGroupName} -> Maybe Text
clusterSecurityGroupName) (\s :: DescribeClusterSecurityGroups
s@DescribeClusterSecurityGroups' {} Maybe Text
a -> DescribeClusterSecurityGroups
s {$sel:clusterSecurityGroupName:DescribeClusterSecurityGroups' :: Maybe Text
clusterSecurityGroupName = Maybe Text
a} :: DescribeClusterSecurityGroups)

-- | An optional parameter that specifies the starting point to return a set
-- of response records. When the results of a DescribeClusterSecurityGroups
-- request exceed the value specified in @MaxRecords@, Amazon Web Services
-- returns a value in the @Marker@ field of the response. You can retrieve
-- the next set of response records by providing the returned marker value
-- in the @Marker@ parameter and retrying the request.
--
-- Constraints: You can specify either the __ClusterSecurityGroupName__
-- parameter or the __Marker__ parameter, but not both.
describeClusterSecurityGroups_marker :: Lens.Lens' DescribeClusterSecurityGroups (Prelude.Maybe Prelude.Text)
describeClusterSecurityGroups_marker :: Lens' DescribeClusterSecurityGroups (Maybe Text)
describeClusterSecurityGroups_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroups' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeClusterSecurityGroups
s@DescribeClusterSecurityGroups' {} Maybe Text
a -> DescribeClusterSecurityGroups
s {$sel:marker:DescribeClusterSecurityGroups' :: Maybe Text
marker = Maybe Text
a} :: DescribeClusterSecurityGroups)

-- | The maximum number of response records to return in each call. If the
-- number of remaining response records exceeds the specified @MaxRecords@
-- value, a value is returned in a @marker@ field of the response. You can
-- retrieve the next set of records by retrying the command with the
-- returned marker value.
--
-- Default: @100@
--
-- Constraints: minimum 20, maximum 100.
describeClusterSecurityGroups_maxRecords :: Lens.Lens' DescribeClusterSecurityGroups (Prelude.Maybe Prelude.Int)
describeClusterSecurityGroups_maxRecords :: Lens' DescribeClusterSecurityGroups (Maybe Int)
describeClusterSecurityGroups_maxRecords = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroups' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeClusterSecurityGroups
s@DescribeClusterSecurityGroups' {} Maybe Int
a -> DescribeClusterSecurityGroups
s {$sel:maxRecords:DescribeClusterSecurityGroups' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeClusterSecurityGroups)

-- | A tag key or keys for which you want to return all matching cluster
-- security groups that are associated with the specified key or keys. For
-- example, suppose that you have security groups that are tagged with keys
-- called @owner@ and @environment@. If you specify both of these tag keys
-- in the request, Amazon Redshift returns a response with the security
-- groups that have either or both of these tag keys associated with them.
describeClusterSecurityGroups_tagKeys :: Lens.Lens' DescribeClusterSecurityGroups (Prelude.Maybe [Prelude.Text])
describeClusterSecurityGroups_tagKeys :: Lens' DescribeClusterSecurityGroups (Maybe [Text])
describeClusterSecurityGroups_tagKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroups' {Maybe [Text]
tagKeys :: Maybe [Text]
$sel:tagKeys:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
tagKeys} -> Maybe [Text]
tagKeys) (\s :: DescribeClusterSecurityGroups
s@DescribeClusterSecurityGroups' {} Maybe [Text]
a -> DescribeClusterSecurityGroups
s {$sel:tagKeys:DescribeClusterSecurityGroups' :: Maybe [Text]
tagKeys = Maybe [Text]
a} :: DescribeClusterSecurityGroups) 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

-- | A tag value or values for which you want to return all matching cluster
-- security groups that are associated with the specified tag value or
-- values. For example, suppose that you have security groups that are
-- tagged with values called @admin@ and @test@. If you specify both of
-- these tag values in the request, Amazon Redshift returns a response with
-- the security groups that have either or both of these tag values
-- associated with them.
describeClusterSecurityGroups_tagValues :: Lens.Lens' DescribeClusterSecurityGroups (Prelude.Maybe [Prelude.Text])
describeClusterSecurityGroups_tagValues :: Lens' DescribeClusterSecurityGroups (Maybe [Text])
describeClusterSecurityGroups_tagValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroups' {Maybe [Text]
tagValues :: Maybe [Text]
$sel:tagValues:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
tagValues} -> Maybe [Text]
tagValues) (\s :: DescribeClusterSecurityGroups
s@DescribeClusterSecurityGroups' {} Maybe [Text]
a -> DescribeClusterSecurityGroups
s {$sel:tagValues:DescribeClusterSecurityGroups' :: Maybe [Text]
tagValues = Maybe [Text]
a} :: DescribeClusterSecurityGroups) 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.AWSPager DescribeClusterSecurityGroups where
  page :: DescribeClusterSecurityGroups
-> AWSResponse DescribeClusterSecurityGroups
-> Maybe DescribeClusterSecurityGroups
page DescribeClusterSecurityGroups
rq AWSResponse DescribeClusterSecurityGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeClusterSecurityGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeClusterSecurityGroupsResponse (Maybe Text)
describeClusterSecurityGroupsResponse_marker
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeClusterSecurityGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeClusterSecurityGroupsResponse
  (Maybe [ClusterSecurityGroup])
describeClusterSecurityGroupsResponse_clusterSecurityGroups
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeClusterSecurityGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeClusterSecurityGroups (Maybe Text)
describeClusterSecurityGroups_marker
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeClusterSecurityGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeClusterSecurityGroupsResponse (Maybe Text)
describeClusterSecurityGroupsResponse_marker
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeClusterSecurityGroups
  where
  type
    AWSResponse DescribeClusterSecurityGroups =
      DescribeClusterSecurityGroupsResponse
  request :: (Service -> Service)
-> DescribeClusterSecurityGroups
-> Request DescribeClusterSecurityGroups
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 DescribeClusterSecurityGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeClusterSecurityGroups)))
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
"DescribeClusterSecurityGroupsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [ClusterSecurityGroup]
-> Maybe Text -> Int -> DescribeClusterSecurityGroupsResponse
DescribeClusterSecurityGroupsResponse'
            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
"ClusterSecurityGroups"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"ClusterSecurityGroup")
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Marker")
            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
    DescribeClusterSecurityGroups
  where
  hashWithSalt :: Int -> DescribeClusterSecurityGroups -> Int
hashWithSalt Int
_salt DescribeClusterSecurityGroups' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
clusterSecurityGroupName :: Maybe Text
$sel:tagValues:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
$sel:tagKeys:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
$sel:maxRecords:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Int
$sel:marker:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
$sel:clusterSecurityGroupName:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterSecurityGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxRecords
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tagValues

instance Prelude.NFData DescribeClusterSecurityGroups where
  rnf :: DescribeClusterSecurityGroups -> ()
rnf DescribeClusterSecurityGroups' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
clusterSecurityGroupName :: Maybe Text
$sel:tagValues:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
$sel:tagKeys:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
$sel:maxRecords:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Int
$sel:marker:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
$sel:clusterSecurityGroupName:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterSecurityGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxRecords
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tagValues

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

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

instance Data.ToQuery DescribeClusterSecurityGroups where
  toQuery :: DescribeClusterSecurityGroups -> QueryString
toQuery DescribeClusterSecurityGroups' {Maybe Int
Maybe [Text]
Maybe Text
tagValues :: Maybe [Text]
tagKeys :: Maybe [Text]
maxRecords :: Maybe Int
marker :: Maybe Text
clusterSecurityGroupName :: Maybe Text
$sel:tagValues:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
$sel:tagKeys:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe [Text]
$sel:maxRecords:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Int
$sel:marker:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
$sel:clusterSecurityGroupName:DescribeClusterSecurityGroups' :: DescribeClusterSecurityGroups -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeClusterSecurityGroups" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ClusterSecurityGroupName"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clusterSecurityGroupName,
        ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
        ByteString
"MaxRecords" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxRecords,
        ByteString
"TagKeys"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagKey" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagKeys),
        ByteString
"TagValues"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagValue" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
tagValues)
      ]

-- |
--
-- /See:/ 'newDescribeClusterSecurityGroupsResponse' smart constructor.
data DescribeClusterSecurityGroupsResponse = DescribeClusterSecurityGroupsResponse'
  { -- | A list of ClusterSecurityGroup instances.
    DescribeClusterSecurityGroupsResponse
-> Maybe [ClusterSecurityGroup]
clusterSecurityGroups :: Prelude.Maybe [ClusterSecurityGroup],
    -- | A value that indicates the starting point for the next set of response
    -- records in a subsequent request. If a value is returned in a response,
    -- you can retrieve the next set of records by providing this returned
    -- marker value in the @Marker@ parameter and retrying the command. If the
    -- @Marker@ field is empty, all response records have been retrieved for
    -- the request.
    DescribeClusterSecurityGroupsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeClusterSecurityGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeClusterSecurityGroupsResponse
-> DescribeClusterSecurityGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeClusterSecurityGroupsResponse
-> DescribeClusterSecurityGroupsResponse -> Bool
$c/= :: DescribeClusterSecurityGroupsResponse
-> DescribeClusterSecurityGroupsResponse -> Bool
== :: DescribeClusterSecurityGroupsResponse
-> DescribeClusterSecurityGroupsResponse -> Bool
$c== :: DescribeClusterSecurityGroupsResponse
-> DescribeClusterSecurityGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeClusterSecurityGroupsResponse]
ReadPrec DescribeClusterSecurityGroupsResponse
Int -> ReadS DescribeClusterSecurityGroupsResponse
ReadS [DescribeClusterSecurityGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeClusterSecurityGroupsResponse]
$creadListPrec :: ReadPrec [DescribeClusterSecurityGroupsResponse]
readPrec :: ReadPrec DescribeClusterSecurityGroupsResponse
$creadPrec :: ReadPrec DescribeClusterSecurityGroupsResponse
readList :: ReadS [DescribeClusterSecurityGroupsResponse]
$creadList :: ReadS [DescribeClusterSecurityGroupsResponse]
readsPrec :: Int -> ReadS DescribeClusterSecurityGroupsResponse
$creadsPrec :: Int -> ReadS DescribeClusterSecurityGroupsResponse
Prelude.Read, Int -> DescribeClusterSecurityGroupsResponse -> ShowS
[DescribeClusterSecurityGroupsResponse] -> ShowS
DescribeClusterSecurityGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeClusterSecurityGroupsResponse] -> ShowS
$cshowList :: [DescribeClusterSecurityGroupsResponse] -> ShowS
show :: DescribeClusterSecurityGroupsResponse -> String
$cshow :: DescribeClusterSecurityGroupsResponse -> String
showsPrec :: Int -> DescribeClusterSecurityGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeClusterSecurityGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeClusterSecurityGroupsResponse x
-> DescribeClusterSecurityGroupsResponse
forall x.
DescribeClusterSecurityGroupsResponse
-> Rep DescribeClusterSecurityGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeClusterSecurityGroupsResponse x
-> DescribeClusterSecurityGroupsResponse
$cfrom :: forall x.
DescribeClusterSecurityGroupsResponse
-> Rep DescribeClusterSecurityGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeClusterSecurityGroupsResponse' 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:
--
-- 'clusterSecurityGroups', 'describeClusterSecurityGroupsResponse_clusterSecurityGroups' - A list of ClusterSecurityGroup instances.
--
-- 'marker', 'describeClusterSecurityGroupsResponse_marker' - A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
--
-- 'httpStatus', 'describeClusterSecurityGroupsResponse_httpStatus' - The response's http status code.
newDescribeClusterSecurityGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeClusterSecurityGroupsResponse
newDescribeClusterSecurityGroupsResponse :: Int -> DescribeClusterSecurityGroupsResponse
newDescribeClusterSecurityGroupsResponse Int
pHttpStatus_ =
  DescribeClusterSecurityGroupsResponse'
    { $sel:clusterSecurityGroups:DescribeClusterSecurityGroupsResponse' :: Maybe [ClusterSecurityGroup]
clusterSecurityGroups =
        forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeClusterSecurityGroupsResponse' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeClusterSecurityGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of ClusterSecurityGroup instances.
describeClusterSecurityGroupsResponse_clusterSecurityGroups :: Lens.Lens' DescribeClusterSecurityGroupsResponse (Prelude.Maybe [ClusterSecurityGroup])
describeClusterSecurityGroupsResponse_clusterSecurityGroups :: Lens'
  DescribeClusterSecurityGroupsResponse
  (Maybe [ClusterSecurityGroup])
describeClusterSecurityGroupsResponse_clusterSecurityGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroupsResponse' {Maybe [ClusterSecurityGroup]
clusterSecurityGroups :: Maybe [ClusterSecurityGroup]
$sel:clusterSecurityGroups:DescribeClusterSecurityGroupsResponse' :: DescribeClusterSecurityGroupsResponse
-> Maybe [ClusterSecurityGroup]
clusterSecurityGroups} -> Maybe [ClusterSecurityGroup]
clusterSecurityGroups) (\s :: DescribeClusterSecurityGroupsResponse
s@DescribeClusterSecurityGroupsResponse' {} Maybe [ClusterSecurityGroup]
a -> DescribeClusterSecurityGroupsResponse
s {$sel:clusterSecurityGroups:DescribeClusterSecurityGroupsResponse' :: Maybe [ClusterSecurityGroup]
clusterSecurityGroups = Maybe [ClusterSecurityGroup]
a} :: DescribeClusterSecurityGroupsResponse) 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

-- | A value that indicates the starting point for the next set of response
-- records in a subsequent request. If a value is returned in a response,
-- you can retrieve the next set of records by providing this returned
-- marker value in the @Marker@ parameter and retrying the command. If the
-- @Marker@ field is empty, all response records have been retrieved for
-- the request.
describeClusterSecurityGroupsResponse_marker :: Lens.Lens' DescribeClusterSecurityGroupsResponse (Prelude.Maybe Prelude.Text)
describeClusterSecurityGroupsResponse_marker :: Lens' DescribeClusterSecurityGroupsResponse (Maybe Text)
describeClusterSecurityGroupsResponse_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeClusterSecurityGroupsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeClusterSecurityGroupsResponse' :: DescribeClusterSecurityGroupsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeClusterSecurityGroupsResponse
s@DescribeClusterSecurityGroupsResponse' {} Maybe Text
a -> DescribeClusterSecurityGroupsResponse
s {$sel:marker:DescribeClusterSecurityGroupsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeClusterSecurityGroupsResponse)

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

instance
  Prelude.NFData
    DescribeClusterSecurityGroupsResponse
  where
  rnf :: DescribeClusterSecurityGroupsResponse -> ()
rnf DescribeClusterSecurityGroupsResponse' {Int
Maybe [ClusterSecurityGroup]
Maybe Text
httpStatus :: Int
marker :: Maybe Text
clusterSecurityGroups :: Maybe [ClusterSecurityGroup]
$sel:httpStatus:DescribeClusterSecurityGroupsResponse' :: DescribeClusterSecurityGroupsResponse -> Int
$sel:marker:DescribeClusterSecurityGroupsResponse' :: DescribeClusterSecurityGroupsResponse -> Maybe Text
$sel:clusterSecurityGroups:DescribeClusterSecurityGroupsResponse' :: DescribeClusterSecurityGroupsResponse
-> Maybe [ClusterSecurityGroup]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ClusterSecurityGroup]
clusterSecurityGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus