{-# 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.DescribeNetworkInterfacePermissions
-- 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 the permissions for your network interfaces.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeNetworkInterfacePermissions
  ( -- * Creating a Request
    DescribeNetworkInterfacePermissions (..),
    newDescribeNetworkInterfacePermissions,

    -- * Request Lenses
    describeNetworkInterfacePermissions_filters,
    describeNetworkInterfacePermissions_maxResults,
    describeNetworkInterfacePermissions_networkInterfacePermissionIds,
    describeNetworkInterfacePermissions_nextToken,

    -- * Destructuring the Response
    DescribeNetworkInterfacePermissionsResponse (..),
    newDescribeNetworkInterfacePermissionsResponse,

    -- * Response Lenses
    describeNetworkInterfacePermissionsResponse_networkInterfacePermissions,
    describeNetworkInterfacePermissionsResponse_nextToken,
    describeNetworkInterfacePermissionsResponse_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

-- | Contains the parameters for DescribeNetworkInterfacePermissions.
--
-- /See:/ 'newDescribeNetworkInterfacePermissions' smart constructor.
data DescribeNetworkInterfacePermissions = DescribeNetworkInterfacePermissions'
  { -- | One or more filters.
    --
    -- -   @network-interface-permission.network-interface-permission-id@ - The
    --     ID of the permission.
    --
    -- -   @network-interface-permission.network-interface-id@ - The ID of the
    --     network interface.
    --
    -- -   @network-interface-permission.aws-account-id@ - The Amazon Web
    --     Services account ID.
    --
    -- -   @network-interface-permission.aws-service@ - The Amazon Web Service.
    --
    -- -   @network-interface-permission.permission@ - The type of permission
    --     (@INSTANCE-ATTACH@ | @EIP-ASSOCIATE@).
    DescribeNetworkInterfacePermissions -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return in a single call. To retrieve
    -- the remaining results, make another call with the returned @NextToken@
    -- value. If this parameter is not specified, up to 50 results are returned
    -- by default.
    DescribeNetworkInterfacePermissions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The network interface permission IDs.
    DescribeNetworkInterfacePermissions -> Maybe [Text]
networkInterfacePermissionIds :: Prelude.Maybe [Prelude.Text],
    -- | The token to request the next page of results.
    DescribeNetworkInterfacePermissions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeNetworkInterfacePermissions
-> DescribeNetworkInterfacePermissions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNetworkInterfacePermissions
-> DescribeNetworkInterfacePermissions -> Bool
$c/= :: DescribeNetworkInterfacePermissions
-> DescribeNetworkInterfacePermissions -> Bool
== :: DescribeNetworkInterfacePermissions
-> DescribeNetworkInterfacePermissions -> Bool
$c== :: DescribeNetworkInterfacePermissions
-> DescribeNetworkInterfacePermissions -> Bool
Prelude.Eq, ReadPrec [DescribeNetworkInterfacePermissions]
ReadPrec DescribeNetworkInterfacePermissions
Int -> ReadS DescribeNetworkInterfacePermissions
ReadS [DescribeNetworkInterfacePermissions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNetworkInterfacePermissions]
$creadListPrec :: ReadPrec [DescribeNetworkInterfacePermissions]
readPrec :: ReadPrec DescribeNetworkInterfacePermissions
$creadPrec :: ReadPrec DescribeNetworkInterfacePermissions
readList :: ReadS [DescribeNetworkInterfacePermissions]
$creadList :: ReadS [DescribeNetworkInterfacePermissions]
readsPrec :: Int -> ReadS DescribeNetworkInterfacePermissions
$creadsPrec :: Int -> ReadS DescribeNetworkInterfacePermissions
Prelude.Read, Int -> DescribeNetworkInterfacePermissions -> ShowS
[DescribeNetworkInterfacePermissions] -> ShowS
DescribeNetworkInterfacePermissions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNetworkInterfacePermissions] -> ShowS
$cshowList :: [DescribeNetworkInterfacePermissions] -> ShowS
show :: DescribeNetworkInterfacePermissions -> String
$cshow :: DescribeNetworkInterfacePermissions -> String
showsPrec :: Int -> DescribeNetworkInterfacePermissions -> ShowS
$cshowsPrec :: Int -> DescribeNetworkInterfacePermissions -> ShowS
Prelude.Show, forall x.
Rep DescribeNetworkInterfacePermissions x
-> DescribeNetworkInterfacePermissions
forall x.
DescribeNetworkInterfacePermissions
-> Rep DescribeNetworkInterfacePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNetworkInterfacePermissions x
-> DescribeNetworkInterfacePermissions
$cfrom :: forall x.
DescribeNetworkInterfacePermissions
-> Rep DescribeNetworkInterfacePermissions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNetworkInterfacePermissions' 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:
--
-- 'filters', 'describeNetworkInterfacePermissions_filters' - One or more filters.
--
-- -   @network-interface-permission.network-interface-permission-id@ - The
--     ID of the permission.
--
-- -   @network-interface-permission.network-interface-id@ - The ID of the
--     network interface.
--
-- -   @network-interface-permission.aws-account-id@ - The Amazon Web
--     Services account ID.
--
-- -   @network-interface-permission.aws-service@ - The Amazon Web Service.
--
-- -   @network-interface-permission.permission@ - The type of permission
--     (@INSTANCE-ATTACH@ | @EIP-ASSOCIATE@).
--
-- 'maxResults', 'describeNetworkInterfacePermissions_maxResults' - The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another call with the returned @NextToken@
-- value. If this parameter is not specified, up to 50 results are returned
-- by default.
--
-- 'networkInterfacePermissionIds', 'describeNetworkInterfacePermissions_networkInterfacePermissionIds' - The network interface permission IDs.
--
-- 'nextToken', 'describeNetworkInterfacePermissions_nextToken' - The token to request the next page of results.
newDescribeNetworkInterfacePermissions ::
  DescribeNetworkInterfacePermissions
newDescribeNetworkInterfacePermissions :: DescribeNetworkInterfacePermissions
newDescribeNetworkInterfacePermissions =
  DescribeNetworkInterfacePermissions'
    { $sel:filters:DescribeNetworkInterfacePermissions' :: Maybe [Filter]
filters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeNetworkInterfacePermissions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfacePermissionIds:DescribeNetworkInterfacePermissions' :: Maybe [Text]
networkInterfacePermissionIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeNetworkInterfacePermissions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | One or more filters.
--
-- -   @network-interface-permission.network-interface-permission-id@ - The
--     ID of the permission.
--
-- -   @network-interface-permission.network-interface-id@ - The ID of the
--     network interface.
--
-- -   @network-interface-permission.aws-account-id@ - The Amazon Web
--     Services account ID.
--
-- -   @network-interface-permission.aws-service@ - The Amazon Web Service.
--
-- -   @network-interface-permission.permission@ - The type of permission
--     (@INSTANCE-ATTACH@ | @EIP-ASSOCIATE@).
describeNetworkInterfacePermissions_filters :: Lens.Lens' DescribeNetworkInterfacePermissions (Prelude.Maybe [Filter])
describeNetworkInterfacePermissions_filters :: Lens' DescribeNetworkInterfacePermissions (Maybe [Filter])
describeNetworkInterfacePermissions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInterfacePermissions' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeNetworkInterfacePermissions
s@DescribeNetworkInterfacePermissions' {} Maybe [Filter]
a -> DescribeNetworkInterfacePermissions
s {$sel:filters:DescribeNetworkInterfacePermissions' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeNetworkInterfacePermissions) 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 in a single call. To retrieve
-- the remaining results, make another call with the returned @NextToken@
-- value. If this parameter is not specified, up to 50 results are returned
-- by default.
describeNetworkInterfacePermissions_maxResults :: Lens.Lens' DescribeNetworkInterfacePermissions (Prelude.Maybe Prelude.Natural)
describeNetworkInterfacePermissions_maxResults :: Lens' DescribeNetworkInterfacePermissions (Maybe Natural)
describeNetworkInterfacePermissions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInterfacePermissions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeNetworkInterfacePermissions
s@DescribeNetworkInterfacePermissions' {} Maybe Natural
a -> DescribeNetworkInterfacePermissions
s {$sel:maxResults:DescribeNetworkInterfacePermissions' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeNetworkInterfacePermissions)

-- | The network interface permission IDs.
describeNetworkInterfacePermissions_networkInterfacePermissionIds :: Lens.Lens' DescribeNetworkInterfacePermissions (Prelude.Maybe [Prelude.Text])
describeNetworkInterfacePermissions_networkInterfacePermissionIds :: Lens' DescribeNetworkInterfacePermissions (Maybe [Text])
describeNetworkInterfacePermissions_networkInterfacePermissionIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInterfacePermissions' {Maybe [Text]
networkInterfacePermissionIds :: Maybe [Text]
$sel:networkInterfacePermissionIds:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe [Text]
networkInterfacePermissionIds} -> Maybe [Text]
networkInterfacePermissionIds) (\s :: DescribeNetworkInterfacePermissions
s@DescribeNetworkInterfacePermissions' {} Maybe [Text]
a -> DescribeNetworkInterfacePermissions
s {$sel:networkInterfacePermissionIds:DescribeNetworkInterfacePermissions' :: Maybe [Text]
networkInterfacePermissionIds = Maybe [Text]
a} :: DescribeNetworkInterfacePermissions) 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 request the next page of results.
describeNetworkInterfacePermissions_nextToken :: Lens.Lens' DescribeNetworkInterfacePermissions (Prelude.Maybe Prelude.Text)
describeNetworkInterfacePermissions_nextToken :: Lens' DescribeNetworkInterfacePermissions (Maybe Text)
describeNetworkInterfacePermissions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInterfacePermissions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNetworkInterfacePermissions
s@DescribeNetworkInterfacePermissions' {} Maybe Text
a -> DescribeNetworkInterfacePermissions
s {$sel:nextToken:DescribeNetworkInterfacePermissions' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNetworkInterfacePermissions)

instance
  Core.AWSPager
    DescribeNetworkInterfacePermissions
  where
  page :: DescribeNetworkInterfacePermissions
-> AWSResponse DescribeNetworkInterfacePermissions
-> Maybe DescribeNetworkInterfacePermissions
page DescribeNetworkInterfacePermissions
rq AWSResponse DescribeNetworkInterfacePermissions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNetworkInterfacePermissions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkInterfacePermissionsResponse (Maybe Text)
describeNetworkInterfacePermissionsResponse_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 DescribeNetworkInterfacePermissions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeNetworkInterfacePermissionsResponse
  (Maybe [NetworkInterfacePermission])
describeNetworkInterfacePermissionsResponse_networkInterfacePermissions
            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.$ DescribeNetworkInterfacePermissions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeNetworkInterfacePermissions (Maybe Text)
describeNetworkInterfacePermissions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeNetworkInterfacePermissions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNetworkInterfacePermissionsResponse (Maybe Text)
describeNetworkInterfacePermissionsResponse_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
    DescribeNetworkInterfacePermissions
  where
  type
    AWSResponse DescribeNetworkInterfacePermissions =
      DescribeNetworkInterfacePermissionsResponse
  request :: (Service -> Service)
-> DescribeNetworkInterfacePermissions
-> Request DescribeNetworkInterfacePermissions
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 DescribeNetworkInterfacePermissions
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeNetworkInterfacePermissions)))
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 [NetworkInterfacePermission]
-> Maybe Text -> Int -> DescribeNetworkInterfacePermissionsResponse
DescribeNetworkInterfacePermissionsResponse'
            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
"networkInterfacePermissions"
                            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
    DescribeNetworkInterfacePermissions
  where
  hashWithSalt :: Int -> DescribeNetworkInterfacePermissions -> Int
hashWithSalt
    Int
_salt
    DescribeNetworkInterfacePermissions' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkInterfacePermissionIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe Text
$sel:networkInterfacePermissionIds:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe [Text]
$sel:maxResults:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe Natural
$sel:filters:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe [Filter]
..} =
      Int
_salt
        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]
networkInterfacePermissionIds
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

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

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

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

instance
  Data.ToQuery
    DescribeNetworkInterfacePermissions
  where
  toQuery :: DescribeNetworkInterfacePermissions -> QueryString
toQuery DescribeNetworkInterfacePermissions' {Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
networkInterfacePermissionIds :: Maybe [Text]
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:nextToken:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe Text
$sel:networkInterfacePermissionIds:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe [Text]
$sel:maxResults:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe Natural
$sel:filters:DescribeNetworkInterfacePermissions' :: DescribeNetworkInterfacePermissions -> Maybe [Filter]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeNetworkInterfacePermissions" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        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
"NetworkInterfacePermissionId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
networkInterfacePermissionIds
          ),
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | Contains the output for DescribeNetworkInterfacePermissions.
--
-- /See:/ 'newDescribeNetworkInterfacePermissionsResponse' smart constructor.
data DescribeNetworkInterfacePermissionsResponse = DescribeNetworkInterfacePermissionsResponse'
  { -- | The network interface permissions.
    DescribeNetworkInterfacePermissionsResponse
-> Maybe [NetworkInterfacePermission]
networkInterfacePermissions :: Prelude.Maybe [NetworkInterfacePermission],
    -- | The token to use to retrieve the next page of results.
    DescribeNetworkInterfacePermissionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeNetworkInterfacePermissionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeNetworkInterfacePermissionsResponse
-> DescribeNetworkInterfacePermissionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeNetworkInterfacePermissionsResponse
-> DescribeNetworkInterfacePermissionsResponse -> Bool
$c/= :: DescribeNetworkInterfacePermissionsResponse
-> DescribeNetworkInterfacePermissionsResponse -> Bool
== :: DescribeNetworkInterfacePermissionsResponse
-> DescribeNetworkInterfacePermissionsResponse -> Bool
$c== :: DescribeNetworkInterfacePermissionsResponse
-> DescribeNetworkInterfacePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeNetworkInterfacePermissionsResponse]
ReadPrec DescribeNetworkInterfacePermissionsResponse
Int -> ReadS DescribeNetworkInterfacePermissionsResponse
ReadS [DescribeNetworkInterfacePermissionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeNetworkInterfacePermissionsResponse]
$creadListPrec :: ReadPrec [DescribeNetworkInterfacePermissionsResponse]
readPrec :: ReadPrec DescribeNetworkInterfacePermissionsResponse
$creadPrec :: ReadPrec DescribeNetworkInterfacePermissionsResponse
readList :: ReadS [DescribeNetworkInterfacePermissionsResponse]
$creadList :: ReadS [DescribeNetworkInterfacePermissionsResponse]
readsPrec :: Int -> ReadS DescribeNetworkInterfacePermissionsResponse
$creadsPrec :: Int -> ReadS DescribeNetworkInterfacePermissionsResponse
Prelude.Read, Int -> DescribeNetworkInterfacePermissionsResponse -> ShowS
[DescribeNetworkInterfacePermissionsResponse] -> ShowS
DescribeNetworkInterfacePermissionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeNetworkInterfacePermissionsResponse] -> ShowS
$cshowList :: [DescribeNetworkInterfacePermissionsResponse] -> ShowS
show :: DescribeNetworkInterfacePermissionsResponse -> String
$cshow :: DescribeNetworkInterfacePermissionsResponse -> String
showsPrec :: Int -> DescribeNetworkInterfacePermissionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeNetworkInterfacePermissionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeNetworkInterfacePermissionsResponse x
-> DescribeNetworkInterfacePermissionsResponse
forall x.
DescribeNetworkInterfacePermissionsResponse
-> Rep DescribeNetworkInterfacePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeNetworkInterfacePermissionsResponse x
-> DescribeNetworkInterfacePermissionsResponse
$cfrom :: forall x.
DescribeNetworkInterfacePermissionsResponse
-> Rep DescribeNetworkInterfacePermissionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeNetworkInterfacePermissionsResponse' 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:
--
-- 'networkInterfacePermissions', 'describeNetworkInterfacePermissionsResponse_networkInterfacePermissions' - The network interface permissions.
--
-- 'nextToken', 'describeNetworkInterfacePermissionsResponse_nextToken' - The token to use to retrieve the next page of results.
--
-- 'httpStatus', 'describeNetworkInterfacePermissionsResponse_httpStatus' - The response's http status code.
newDescribeNetworkInterfacePermissionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeNetworkInterfacePermissionsResponse
newDescribeNetworkInterfacePermissionsResponse :: Int -> DescribeNetworkInterfacePermissionsResponse
newDescribeNetworkInterfacePermissionsResponse
  Int
pHttpStatus_ =
    DescribeNetworkInterfacePermissionsResponse'
      { $sel:networkInterfacePermissions:DescribeNetworkInterfacePermissionsResponse' :: Maybe [NetworkInterfacePermission]
networkInterfacePermissions =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeNetworkInterfacePermissionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeNetworkInterfacePermissionsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The network interface permissions.
describeNetworkInterfacePermissionsResponse_networkInterfacePermissions :: Lens.Lens' DescribeNetworkInterfacePermissionsResponse (Prelude.Maybe [NetworkInterfacePermission])
describeNetworkInterfacePermissionsResponse_networkInterfacePermissions :: Lens'
  DescribeNetworkInterfacePermissionsResponse
  (Maybe [NetworkInterfacePermission])
describeNetworkInterfacePermissionsResponse_networkInterfacePermissions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInterfacePermissionsResponse' {Maybe [NetworkInterfacePermission]
networkInterfacePermissions :: Maybe [NetworkInterfacePermission]
$sel:networkInterfacePermissions:DescribeNetworkInterfacePermissionsResponse' :: DescribeNetworkInterfacePermissionsResponse
-> Maybe [NetworkInterfacePermission]
networkInterfacePermissions} -> Maybe [NetworkInterfacePermission]
networkInterfacePermissions) (\s :: DescribeNetworkInterfacePermissionsResponse
s@DescribeNetworkInterfacePermissionsResponse' {} Maybe [NetworkInterfacePermission]
a -> DescribeNetworkInterfacePermissionsResponse
s {$sel:networkInterfacePermissions:DescribeNetworkInterfacePermissionsResponse' :: Maybe [NetworkInterfacePermission]
networkInterfacePermissions = Maybe [NetworkInterfacePermission]
a} :: DescribeNetworkInterfacePermissionsResponse) 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.
describeNetworkInterfacePermissionsResponse_nextToken :: Lens.Lens' DescribeNetworkInterfacePermissionsResponse (Prelude.Maybe Prelude.Text)
describeNetworkInterfacePermissionsResponse_nextToken :: Lens' DescribeNetworkInterfacePermissionsResponse (Maybe Text)
describeNetworkInterfacePermissionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNetworkInterfacePermissionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeNetworkInterfacePermissionsResponse' :: DescribeNetworkInterfacePermissionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeNetworkInterfacePermissionsResponse
s@DescribeNetworkInterfacePermissionsResponse' {} Maybe Text
a -> DescribeNetworkInterfacePermissionsResponse
s {$sel:nextToken:DescribeNetworkInterfacePermissionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeNetworkInterfacePermissionsResponse)

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

instance
  Prelude.NFData
    DescribeNetworkInterfacePermissionsResponse
  where
  rnf :: DescribeNetworkInterfacePermissionsResponse -> ()
rnf DescribeNetworkInterfacePermissionsResponse' {Int
Maybe [NetworkInterfacePermission]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
networkInterfacePermissions :: Maybe [NetworkInterfacePermission]
$sel:httpStatus:DescribeNetworkInterfacePermissionsResponse' :: DescribeNetworkInterfacePermissionsResponse -> Int
$sel:nextToken:DescribeNetworkInterfacePermissionsResponse' :: DescribeNetworkInterfacePermissionsResponse -> Maybe Text
$sel:networkInterfacePermissions:DescribeNetworkInterfacePermissionsResponse' :: DescribeNetworkInterfacePermissionsResponse
-> Maybe [NetworkInterfacePermission]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkInterfacePermission]
networkInterfacePermissions
      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