{-# 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.DescribeNetworkAcls
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes one or more of your network ACLs.
--
-- For more information, see
-- <https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html Network ACLs>
-- in the /Amazon Virtual Private Cloud User Guide/.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeNetworkAcls
  ( -- * Creating a Request
    DescribeNetworkAcls (..),
    newDescribeNetworkAcls,

    -- * Request Lenses
    describeNetworkAcls_dryRun,
    describeNetworkAcls_filters,
    describeNetworkAcls_maxResults,
    describeNetworkAcls_networkAclIds,
    describeNetworkAcls_nextToken,

    -- * Destructuring the Response
    DescribeNetworkAclsResponse (..),
    newDescribeNetworkAclsResponse,

    -- * Response Lenses
    describeNetworkAclsResponse_networkAcls,
    describeNetworkAclsResponse_nextToken,
    describeNetworkAclsResponse_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:/ 'newDescribeNetworkAcls' smart constructor.
data DescribeNetworkAcls = DescribeNetworkAcls'
  { -- | 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@.
    DescribeNetworkAcls -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @association.association-id@ - The ID of an association ID for the
    --     ACL.
    --
    -- -   @association.network-acl-id@ - The ID of the network ACL involved in
    --     the association.
    --
    -- -   @association.subnet-id@ - The ID of the subnet involved in the
    --     association.
    --
    -- -   @default@ - Indicates whether the ACL is the default network ACL for
    --     the VPC.
    --
    -- -   @entry.cidr@ - The IPv4 CIDR range specified in the entry.
    --
    -- -   @entry.icmp.code@ - The ICMP code specified in the entry, if any.
    --
    -- -   @entry.icmp.type@ - The ICMP type specified in the entry, if any.
    --
    -- -   @entry.ipv6-cidr@ - The IPv6 CIDR range specified in the entry.
    --
    -- -   @entry.port-range.from@ - The start of the port range specified in
    --     the entry.
    --
    -- -   @entry.port-range.to@ - The end of the port range specified in the
    --     entry.
    --
    -- -   @entry.protocol@ - The protocol specified in the entry (@tcp@ |
    --     @udp@ | @icmp@ or a protocol number).
    --
    -- -   @entry.rule-action@ - Allows or denies the matching traffic (@allow@
    --     | @deny@).
    --
    -- -   @entry.egress@ - A Boolean that indicates the type of rule. Specify
    --     @true@ for egress rules, or @false@ for ingress rules.
    --
    -- -   @entry.rule-number@ - The number of an entry (in other words, rule)
    --     in the set of ACL entries.
    --
    -- -   @network-acl-id@ - The ID of the network ACL.
    --
    -- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
    --     network ACL.
    --
    -- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
    --     resource. Use the tag key in the filter name and the tag value as
    --     the filter value. For example, to find all resources that have a tag
    --     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
    --     the filter name and @TeamA@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the resource. Use this
    --     filter to find all resources assigned a tag with a specific key,
    --     regardless of the tag value.
    --
    -- -   @vpc-id@ - The ID of the VPC for the network ACL.
    DescribeNetworkAcls -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    DescribeNetworkAcls -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | One or more network ACL IDs.
    --
    -- Default: Describes all your network ACLs.
    DescribeNetworkAcls -> Maybe [Text]
networkAclIds :: Prelude.Maybe [Prelude.Text],
    -- | The token for the next page of results.
    DescribeNetworkAcls -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeNetworkAcls -> DescribeNetworkAcls -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNetworkAcls -> DescribeNetworkAcls -> Bool
$c/= :: DescribeNetworkAcls -> DescribeNetworkAcls -> Bool
== :: DescribeNetworkAcls -> DescribeNetworkAcls -> Bool
$c== :: DescribeNetworkAcls -> DescribeNetworkAcls -> Bool
Prelude.Eq, ReadPrec [DescribeNetworkAcls]
ReadPrec DescribeNetworkAcls
Int -> ReadS DescribeNetworkAcls
ReadS [DescribeNetworkAcls]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNetworkAcls]
$creadListPrec :: ReadPrec [DescribeNetworkAcls]
readPrec :: ReadPrec DescribeNetworkAcls
$creadPrec :: ReadPrec DescribeNetworkAcls
readList :: ReadS [DescribeNetworkAcls]
$creadList :: ReadS [DescribeNetworkAcls]
readsPrec :: Int -> ReadS DescribeNetworkAcls
$creadsPrec :: Int -> ReadS DescribeNetworkAcls
Prelude.Read, Int -> DescribeNetworkAcls -> ShowS
[DescribeNetworkAcls] -> ShowS
DescribeNetworkAcls -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNetworkAcls] -> ShowS
$cshowList :: [DescribeNetworkAcls] -> ShowS
show :: DescribeNetworkAcls -> String
$cshow :: DescribeNetworkAcls -> String
showsPrec :: Int -> DescribeNetworkAcls -> ShowS
$cshowsPrec :: Int -> DescribeNetworkAcls -> ShowS
Prelude.Show, forall x. Rep DescribeNetworkAcls x -> DescribeNetworkAcls
forall x. DescribeNetworkAcls -> Rep DescribeNetworkAcls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeNetworkAcls x -> DescribeNetworkAcls
$cfrom :: forall x. DescribeNetworkAcls -> Rep DescribeNetworkAcls x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNetworkAcls' 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', 'describeNetworkAcls_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@.
--
-- 'filters', 'describeNetworkAcls_filters' - One or more filters.
--
-- -   @association.association-id@ - The ID of an association ID for the
--     ACL.
--
-- -   @association.network-acl-id@ - The ID of the network ACL involved in
--     the association.
--
-- -   @association.subnet-id@ - The ID of the subnet involved in the
--     association.
--
-- -   @default@ - Indicates whether the ACL is the default network ACL for
--     the VPC.
--
-- -   @entry.cidr@ - The IPv4 CIDR range specified in the entry.
--
-- -   @entry.icmp.code@ - The ICMP code specified in the entry, if any.
--
-- -   @entry.icmp.type@ - The ICMP type specified in the entry, if any.
--
-- -   @entry.ipv6-cidr@ - The IPv6 CIDR range specified in the entry.
--
-- -   @entry.port-range.from@ - The start of the port range specified in
--     the entry.
--
-- -   @entry.port-range.to@ - The end of the port range specified in the
--     entry.
--
-- -   @entry.protocol@ - The protocol specified in the entry (@tcp@ |
--     @udp@ | @icmp@ or a protocol number).
--
-- -   @entry.rule-action@ - Allows or denies the matching traffic (@allow@
--     | @deny@).
--
-- -   @entry.egress@ - A Boolean that indicates the type of rule. Specify
--     @true@ for egress rules, or @false@ for ingress rules.
--
-- -   @entry.rule-number@ - The number of an entry (in other words, rule)
--     in the set of ACL entries.
--
-- -   @network-acl-id@ - The ID of the network ACL.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     network ACL.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- -   @vpc-id@ - The ID of the VPC for the network ACL.
--
-- 'maxResults', 'describeNetworkAcls_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'networkAclIds', 'describeNetworkAcls_networkAclIds' - One or more network ACL IDs.
--
-- Default: Describes all your network ACLs.
--
-- 'nextToken', 'describeNetworkAcls_nextToken' - The token for the next page of results.
newDescribeNetworkAcls ::
  DescribeNetworkAcls
newDescribeNetworkAcls :: DescribeNetworkAcls
newDescribeNetworkAcls =
  DescribeNetworkAcls'
    { $sel:dryRun:DescribeNetworkAcls' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeNetworkAcls' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeNetworkAcls' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:networkAclIds:DescribeNetworkAcls' :: Maybe [Text]
networkAclIds = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeNetworkAcls' :: Maybe Text
nextToken = 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@.
describeNetworkAcls_dryRun :: Lens.Lens' DescribeNetworkAcls (Prelude.Maybe Prelude.Bool)
describeNetworkAcls_dryRun :: Lens' DescribeNetworkAcls (Maybe Bool)
describeNetworkAcls_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAcls' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeNetworkAcls
s@DescribeNetworkAcls' {} Maybe Bool
a -> DescribeNetworkAcls
s {$sel:dryRun:DescribeNetworkAcls' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeNetworkAcls)

-- | One or more filters.
--
-- -   @association.association-id@ - The ID of an association ID for the
--     ACL.
--
-- -   @association.network-acl-id@ - The ID of the network ACL involved in
--     the association.
--
-- -   @association.subnet-id@ - The ID of the subnet involved in the
--     association.
--
-- -   @default@ - Indicates whether the ACL is the default network ACL for
--     the VPC.
--
-- -   @entry.cidr@ - The IPv4 CIDR range specified in the entry.
--
-- -   @entry.icmp.code@ - The ICMP code specified in the entry, if any.
--
-- -   @entry.icmp.type@ - The ICMP type specified in the entry, if any.
--
-- -   @entry.ipv6-cidr@ - The IPv6 CIDR range specified in the entry.
--
-- -   @entry.port-range.from@ - The start of the port range specified in
--     the entry.
--
-- -   @entry.port-range.to@ - The end of the port range specified in the
--     entry.
--
-- -   @entry.protocol@ - The protocol specified in the entry (@tcp@ |
--     @udp@ | @icmp@ or a protocol number).
--
-- -   @entry.rule-action@ - Allows or denies the matching traffic (@allow@
--     | @deny@).
--
-- -   @entry.egress@ - A Boolean that indicates the type of rule. Specify
--     @true@ for egress rules, or @false@ for ingress rules.
--
-- -   @entry.rule-number@ - The number of an entry (in other words, rule)
--     in the set of ACL entries.
--
-- -   @network-acl-id@ - The ID of the network ACL.
--
-- -   @owner-id@ - The ID of the Amazon Web Services account that owns the
--     network ACL.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- -   @vpc-id@ - The ID of the VPC for the network ACL.
describeNetworkAcls_filters :: Lens.Lens' DescribeNetworkAcls (Prelude.Maybe [Filter])
describeNetworkAcls_filters :: Lens' DescribeNetworkAcls (Maybe [Filter])
describeNetworkAcls_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAcls' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeNetworkAcls
s@DescribeNetworkAcls' {} Maybe [Filter]
a -> DescribeNetworkAcls
s {$sel:filters:DescribeNetworkAcls' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeNetworkAcls) 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 maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
describeNetworkAcls_maxResults :: Lens.Lens' DescribeNetworkAcls (Prelude.Maybe Prelude.Natural)
describeNetworkAcls_maxResults :: Lens' DescribeNetworkAcls (Maybe Natural)
describeNetworkAcls_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAcls' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeNetworkAcls
s@DescribeNetworkAcls' {} Maybe Natural
a -> DescribeNetworkAcls
s {$sel:maxResults:DescribeNetworkAcls' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeNetworkAcls)

-- | One or more network ACL IDs.
--
-- Default: Describes all your network ACLs.
describeNetworkAcls_networkAclIds :: Lens.Lens' DescribeNetworkAcls (Prelude.Maybe [Prelude.Text])
describeNetworkAcls_networkAclIds :: Lens' DescribeNetworkAcls (Maybe [Text])
describeNetworkAcls_networkAclIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAcls' {Maybe [Text]
networkAclIds :: Maybe [Text]
$sel:networkAclIds:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Text]
networkAclIds} -> Maybe [Text]
networkAclIds) (\s :: DescribeNetworkAcls
s@DescribeNetworkAcls' {} Maybe [Text]
a -> DescribeNetworkAcls
s {$sel:networkAclIds:DescribeNetworkAcls' :: Maybe [Text]
networkAclIds = Maybe [Text]
a} :: DescribeNetworkAcls) 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 token for the next page of results.
describeNetworkAcls_nextToken :: Lens.Lens' DescribeNetworkAcls (Prelude.Maybe Prelude.Text)
describeNetworkAcls_nextToken :: Lens' DescribeNetworkAcls (Maybe Text)
describeNetworkAcls_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAcls' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNetworkAcls
s@DescribeNetworkAcls' {} Maybe Text
a -> DescribeNetworkAcls
s {$sel:nextToken:DescribeNetworkAcls' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNetworkAcls)

instance Core.AWSPager DescribeNetworkAcls where
  page :: DescribeNetworkAcls
-> AWSResponse DescribeNetworkAcls -> Maybe DescribeNetworkAcls
page DescribeNetworkAcls
rq AWSResponse DescribeNetworkAcls
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNetworkAcls
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkAclsResponse (Maybe Text)
describeNetworkAclsResponse_nextToken
            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 DescribeNetworkAcls
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkAclsResponse (Maybe [NetworkAcl])
describeNetworkAclsResponse_networkAcls
            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.$ DescribeNetworkAcls
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeNetworkAcls (Maybe Text)
describeNetworkAcls_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeNetworkAcls
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkAclsResponse (Maybe Text)
describeNetworkAclsResponse_nextToken
          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 DescribeNetworkAcls where
  type
    AWSResponse DescribeNetworkAcls =
      DescribeNetworkAclsResponse
  request :: (Service -> Service)
-> DescribeNetworkAcls -> Request DescribeNetworkAcls
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 DescribeNetworkAcls
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeNetworkAcls)))
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 [NetworkAcl]
-> Maybe Text -> Int -> DescribeNetworkAclsResponse
DescribeNetworkAclsResponse'
            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
"networkAclSet"
                            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
"item")
                        )
            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
"nextToken")
            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 DescribeNetworkAcls where
  hashWithSalt :: Int -> DescribeNetworkAcls -> Int
hashWithSalt Int
_salt DescribeNetworkAcls' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkAclIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Text
$sel:networkAclIds:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Text]
$sel:maxResults:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Natural
$sel:filters:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Filter]
$sel:dryRun:DescribeNetworkAcls' :: DescribeNetworkAcls -> 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 [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
networkAclIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeNetworkAcls where
  rnf :: DescribeNetworkAcls -> ()
rnf DescribeNetworkAcls' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkAclIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Text
$sel:networkAclIds:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Text]
$sel:maxResults:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Natural
$sel:filters:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Filter]
$sel:dryRun:DescribeNetworkAcls' :: DescribeNetworkAcls -> 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 [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
networkAclIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

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

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

instance Data.ToQuery DescribeNetworkAcls where
  toQuery :: DescribeNetworkAcls -> QueryString
toQuery DescribeNetworkAcls' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkAclIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:nextToken:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Text
$sel:networkAclIds:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Text]
$sel:maxResults:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Natural
$sel:filters:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe [Filter]
$sel:dryRun:DescribeNetworkAcls' :: DescribeNetworkAcls -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeNetworkAcls" :: 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,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"NetworkAclId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
networkAclIds
          ),
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newDescribeNetworkAclsResponse' smart constructor.
data DescribeNetworkAclsResponse = DescribeNetworkAclsResponse'
  { -- | Information about one or more network ACLs.
    DescribeNetworkAclsResponse -> Maybe [NetworkAcl]
networkAcls :: Prelude.Maybe [NetworkAcl],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeNetworkAclsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeNetworkAclsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeNetworkAclsResponse -> DescribeNetworkAclsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNetworkAclsResponse -> DescribeNetworkAclsResponse -> Bool
$c/= :: DescribeNetworkAclsResponse -> DescribeNetworkAclsResponse -> Bool
== :: DescribeNetworkAclsResponse -> DescribeNetworkAclsResponse -> Bool
$c== :: DescribeNetworkAclsResponse -> DescribeNetworkAclsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeNetworkAclsResponse]
ReadPrec DescribeNetworkAclsResponse
Int -> ReadS DescribeNetworkAclsResponse
ReadS [DescribeNetworkAclsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNetworkAclsResponse]
$creadListPrec :: ReadPrec [DescribeNetworkAclsResponse]
readPrec :: ReadPrec DescribeNetworkAclsResponse
$creadPrec :: ReadPrec DescribeNetworkAclsResponse
readList :: ReadS [DescribeNetworkAclsResponse]
$creadList :: ReadS [DescribeNetworkAclsResponse]
readsPrec :: Int -> ReadS DescribeNetworkAclsResponse
$creadsPrec :: Int -> ReadS DescribeNetworkAclsResponse
Prelude.Read, Int -> DescribeNetworkAclsResponse -> ShowS
[DescribeNetworkAclsResponse] -> ShowS
DescribeNetworkAclsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNetworkAclsResponse] -> ShowS
$cshowList :: [DescribeNetworkAclsResponse] -> ShowS
show :: DescribeNetworkAclsResponse -> String
$cshow :: DescribeNetworkAclsResponse -> String
showsPrec :: Int -> DescribeNetworkAclsResponse -> ShowS
$cshowsPrec :: Int -> DescribeNetworkAclsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeNetworkAclsResponse x -> DescribeNetworkAclsResponse
forall x.
DescribeNetworkAclsResponse -> Rep DescribeNetworkAclsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNetworkAclsResponse x -> DescribeNetworkAclsResponse
$cfrom :: forall x.
DescribeNetworkAclsResponse -> Rep DescribeNetworkAclsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNetworkAclsResponse' 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:
--
-- 'networkAcls', 'describeNetworkAclsResponse_networkAcls' - Information about one or more network ACLs.
--
-- 'nextToken', 'describeNetworkAclsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeNetworkAclsResponse_httpStatus' - The response's http status code.
newDescribeNetworkAclsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeNetworkAclsResponse
newDescribeNetworkAclsResponse :: Int -> DescribeNetworkAclsResponse
newDescribeNetworkAclsResponse Int
pHttpStatus_ =
  DescribeNetworkAclsResponse'
    { $sel:networkAcls:DescribeNetworkAclsResponse' :: Maybe [NetworkAcl]
networkAcls =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeNetworkAclsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeNetworkAclsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about one or more network ACLs.
describeNetworkAclsResponse_networkAcls :: Lens.Lens' DescribeNetworkAclsResponse (Prelude.Maybe [NetworkAcl])
describeNetworkAclsResponse_networkAcls :: Lens' DescribeNetworkAclsResponse (Maybe [NetworkAcl])
describeNetworkAclsResponse_networkAcls = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAclsResponse' {Maybe [NetworkAcl]
networkAcls :: Maybe [NetworkAcl]
$sel:networkAcls:DescribeNetworkAclsResponse' :: DescribeNetworkAclsResponse -> Maybe [NetworkAcl]
networkAcls} -> Maybe [NetworkAcl]
networkAcls) (\s :: DescribeNetworkAclsResponse
s@DescribeNetworkAclsResponse' {} Maybe [NetworkAcl]
a -> DescribeNetworkAclsResponse
s {$sel:networkAcls:DescribeNetworkAclsResponse' :: Maybe [NetworkAcl]
networkAcls = Maybe [NetworkAcl]
a} :: DescribeNetworkAclsResponse) 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeNetworkAclsResponse_nextToken :: Lens.Lens' DescribeNetworkAclsResponse (Prelude.Maybe Prelude.Text)
describeNetworkAclsResponse_nextToken :: Lens' DescribeNetworkAclsResponse (Maybe Text)
describeNetworkAclsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkAclsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNetworkAclsResponse' :: DescribeNetworkAclsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNetworkAclsResponse
s@DescribeNetworkAclsResponse' {} Maybe Text
a -> DescribeNetworkAclsResponse
s {$sel:nextToken:DescribeNetworkAclsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNetworkAclsResponse)

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

instance Prelude.NFData DescribeNetworkAclsResponse where
  rnf :: DescribeNetworkAclsResponse -> ()
rnf DescribeNetworkAclsResponse' {Int
Maybe [NetworkAcl]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
networkAcls :: Maybe [NetworkAcl]
$sel:httpStatus:DescribeNetworkAclsResponse' :: DescribeNetworkAclsResponse -> Int
$sel:nextToken:DescribeNetworkAclsResponse' :: DescribeNetworkAclsResponse -> Maybe Text
$sel:networkAcls:DescribeNetworkAclsResponse' :: DescribeNetworkAclsResponse -> Maybe [NetworkAcl]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkAcl]
networkAcls
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus