{-# 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.ResetNetworkInterfaceAttribute
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Resets a network interface attribute. You can specify only one attribute
-- at a time.
module Amazonka.EC2.ResetNetworkInterfaceAttribute
  ( -- * Creating a Request
    ResetNetworkInterfaceAttribute (..),
    newResetNetworkInterfaceAttribute,

    -- * Request Lenses
    resetNetworkInterfaceAttribute_dryRun,
    resetNetworkInterfaceAttribute_sourceDestCheck,
    resetNetworkInterfaceAttribute_networkInterfaceId,

    -- * Destructuring the Response
    ResetNetworkInterfaceAttributeResponse (..),
    newResetNetworkInterfaceAttributeResponse,
  )
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 ResetNetworkInterfaceAttribute.
--
-- /See:/ 'newResetNetworkInterfaceAttribute' smart constructor.
data ResetNetworkInterfaceAttribute = ResetNetworkInterfaceAttribute'
  { -- | 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@.
    ResetNetworkInterfaceAttribute -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The source\/destination checking attribute. Resets the value to @true@.
    ResetNetworkInterfaceAttribute -> Maybe Text
sourceDestCheck :: Prelude.Maybe Prelude.Text,
    -- | The ID of the network interface.
    ResetNetworkInterfaceAttribute -> Text
networkInterfaceId :: Prelude.Text
  }
  deriving (ResetNetworkInterfaceAttribute
-> ResetNetworkInterfaceAttribute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetNetworkInterfaceAttribute
-> ResetNetworkInterfaceAttribute -> Bool
$c/= :: ResetNetworkInterfaceAttribute
-> ResetNetworkInterfaceAttribute -> Bool
== :: ResetNetworkInterfaceAttribute
-> ResetNetworkInterfaceAttribute -> Bool
$c== :: ResetNetworkInterfaceAttribute
-> ResetNetworkInterfaceAttribute -> Bool
Prelude.Eq, ReadPrec [ResetNetworkInterfaceAttribute]
ReadPrec ResetNetworkInterfaceAttribute
Int -> ReadS ResetNetworkInterfaceAttribute
ReadS [ResetNetworkInterfaceAttribute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetNetworkInterfaceAttribute]
$creadListPrec :: ReadPrec [ResetNetworkInterfaceAttribute]
readPrec :: ReadPrec ResetNetworkInterfaceAttribute
$creadPrec :: ReadPrec ResetNetworkInterfaceAttribute
readList :: ReadS [ResetNetworkInterfaceAttribute]
$creadList :: ReadS [ResetNetworkInterfaceAttribute]
readsPrec :: Int -> ReadS ResetNetworkInterfaceAttribute
$creadsPrec :: Int -> ReadS ResetNetworkInterfaceAttribute
Prelude.Read, Int -> ResetNetworkInterfaceAttribute -> ShowS
[ResetNetworkInterfaceAttribute] -> ShowS
ResetNetworkInterfaceAttribute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetNetworkInterfaceAttribute] -> ShowS
$cshowList :: [ResetNetworkInterfaceAttribute] -> ShowS
show :: ResetNetworkInterfaceAttribute -> String
$cshow :: ResetNetworkInterfaceAttribute -> String
showsPrec :: Int -> ResetNetworkInterfaceAttribute -> ShowS
$cshowsPrec :: Int -> ResetNetworkInterfaceAttribute -> ShowS
Prelude.Show, forall x.
Rep ResetNetworkInterfaceAttribute x
-> ResetNetworkInterfaceAttribute
forall x.
ResetNetworkInterfaceAttribute
-> Rep ResetNetworkInterfaceAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResetNetworkInterfaceAttribute x
-> ResetNetworkInterfaceAttribute
$cfrom :: forall x.
ResetNetworkInterfaceAttribute
-> Rep ResetNetworkInterfaceAttribute x
Prelude.Generic)

-- |
-- Create a value of 'ResetNetworkInterfaceAttribute' 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', 'resetNetworkInterfaceAttribute_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@.
--
-- 'sourceDestCheck', 'resetNetworkInterfaceAttribute_sourceDestCheck' - The source\/destination checking attribute. Resets the value to @true@.
--
-- 'networkInterfaceId', 'resetNetworkInterfaceAttribute_networkInterfaceId' - The ID of the network interface.
newResetNetworkInterfaceAttribute ::
  -- | 'networkInterfaceId'
  Prelude.Text ->
  ResetNetworkInterfaceAttribute
newResetNetworkInterfaceAttribute :: Text -> ResetNetworkInterfaceAttribute
newResetNetworkInterfaceAttribute
  Text
pNetworkInterfaceId_ =
    ResetNetworkInterfaceAttribute'
      { $sel:dryRun:ResetNetworkInterfaceAttribute' :: Maybe Bool
dryRun =
          forall a. Maybe a
Prelude.Nothing,
        $sel:sourceDestCheck:ResetNetworkInterfaceAttribute' :: Maybe Text
sourceDestCheck = forall a. Maybe a
Prelude.Nothing,
        $sel:networkInterfaceId:ResetNetworkInterfaceAttribute' :: Text
networkInterfaceId = Text
pNetworkInterfaceId_
      }

-- | 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@.
resetNetworkInterfaceAttribute_dryRun :: Lens.Lens' ResetNetworkInterfaceAttribute (Prelude.Maybe Prelude.Bool)
resetNetworkInterfaceAttribute_dryRun :: Lens' ResetNetworkInterfaceAttribute (Maybe Bool)
resetNetworkInterfaceAttribute_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetNetworkInterfaceAttribute' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ResetNetworkInterfaceAttribute
s@ResetNetworkInterfaceAttribute' {} Maybe Bool
a -> ResetNetworkInterfaceAttribute
s {$sel:dryRun:ResetNetworkInterfaceAttribute' :: Maybe Bool
dryRun = Maybe Bool
a} :: ResetNetworkInterfaceAttribute)

-- | The source\/destination checking attribute. Resets the value to @true@.
resetNetworkInterfaceAttribute_sourceDestCheck :: Lens.Lens' ResetNetworkInterfaceAttribute (Prelude.Maybe Prelude.Text)
resetNetworkInterfaceAttribute_sourceDestCheck :: Lens' ResetNetworkInterfaceAttribute (Maybe Text)
resetNetworkInterfaceAttribute_sourceDestCheck = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetNetworkInterfaceAttribute' {Maybe Text
sourceDestCheck :: Maybe Text
$sel:sourceDestCheck:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Text
sourceDestCheck} -> Maybe Text
sourceDestCheck) (\s :: ResetNetworkInterfaceAttribute
s@ResetNetworkInterfaceAttribute' {} Maybe Text
a -> ResetNetworkInterfaceAttribute
s {$sel:sourceDestCheck:ResetNetworkInterfaceAttribute' :: Maybe Text
sourceDestCheck = Maybe Text
a} :: ResetNetworkInterfaceAttribute)

-- | The ID of the network interface.
resetNetworkInterfaceAttribute_networkInterfaceId :: Lens.Lens' ResetNetworkInterfaceAttribute Prelude.Text
resetNetworkInterfaceAttribute_networkInterfaceId :: Lens' ResetNetworkInterfaceAttribute Text
resetNetworkInterfaceAttribute_networkInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetNetworkInterfaceAttribute' {Text
networkInterfaceId :: Text
$sel:networkInterfaceId:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Text
networkInterfaceId} -> Text
networkInterfaceId) (\s :: ResetNetworkInterfaceAttribute
s@ResetNetworkInterfaceAttribute' {} Text
a -> ResetNetworkInterfaceAttribute
s {$sel:networkInterfaceId:ResetNetworkInterfaceAttribute' :: Text
networkInterfaceId = Text
a} :: ResetNetworkInterfaceAttribute)

instance
  Core.AWSRequest
    ResetNetworkInterfaceAttribute
  where
  type
    AWSResponse ResetNetworkInterfaceAttribute =
      ResetNetworkInterfaceAttributeResponse
  request :: (Service -> Service)
-> ResetNetworkInterfaceAttribute
-> Request ResetNetworkInterfaceAttribute
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 ResetNetworkInterfaceAttribute
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ResetNetworkInterfaceAttribute)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      ResetNetworkInterfaceAttributeResponse
ResetNetworkInterfaceAttributeResponse'

instance
  Prelude.Hashable
    ResetNetworkInterfaceAttribute
  where
  hashWithSalt :: Int -> ResetNetworkInterfaceAttribute -> Int
hashWithSalt
    Int
_salt
    ResetNetworkInterfaceAttribute' {Maybe Bool
Maybe Text
Text
networkInterfaceId :: Text
sourceDestCheck :: Maybe Text
dryRun :: Maybe Bool
$sel:networkInterfaceId:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Text
$sel:sourceDestCheck:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Text
$sel:dryRun:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceDestCheck
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkInterfaceId

instance
  Prelude.NFData
    ResetNetworkInterfaceAttribute
  where
  rnf :: ResetNetworkInterfaceAttribute -> ()
rnf ResetNetworkInterfaceAttribute' {Maybe Bool
Maybe Text
Text
networkInterfaceId :: Text
sourceDestCheck :: Maybe Text
dryRun :: Maybe Bool
$sel:networkInterfaceId:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Text
$sel:sourceDestCheck:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Text
$sel:dryRun:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceDestCheck
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkInterfaceId

instance
  Data.ToHeaders
    ResetNetworkInterfaceAttribute
  where
  toHeaders :: ResetNetworkInterfaceAttribute -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery ResetNetworkInterfaceAttribute where
  toQuery :: ResetNetworkInterfaceAttribute -> QueryString
toQuery ResetNetworkInterfaceAttribute' {Maybe Bool
Maybe Text
Text
networkInterfaceId :: Text
sourceDestCheck :: Maybe Text
dryRun :: Maybe Bool
$sel:networkInterfaceId:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Text
$sel:sourceDestCheck:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Text
$sel:dryRun:ResetNetworkInterfaceAttribute' :: ResetNetworkInterfaceAttribute -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"ResetNetworkInterfaceAttribute" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"SourceDestCheck" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceDestCheck,
        ByteString
"NetworkInterfaceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
networkInterfaceId
      ]

-- | /See:/ 'newResetNetworkInterfaceAttributeResponse' smart constructor.
data ResetNetworkInterfaceAttributeResponse = ResetNetworkInterfaceAttributeResponse'
  {
  }
  deriving (ResetNetworkInterfaceAttributeResponse
-> ResetNetworkInterfaceAttributeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetNetworkInterfaceAttributeResponse
-> ResetNetworkInterfaceAttributeResponse -> Bool
$c/= :: ResetNetworkInterfaceAttributeResponse
-> ResetNetworkInterfaceAttributeResponse -> Bool
== :: ResetNetworkInterfaceAttributeResponse
-> ResetNetworkInterfaceAttributeResponse -> Bool
$c== :: ResetNetworkInterfaceAttributeResponse
-> ResetNetworkInterfaceAttributeResponse -> Bool
Prelude.Eq, ReadPrec [ResetNetworkInterfaceAttributeResponse]
ReadPrec ResetNetworkInterfaceAttributeResponse
Int -> ReadS ResetNetworkInterfaceAttributeResponse
ReadS [ResetNetworkInterfaceAttributeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetNetworkInterfaceAttributeResponse]
$creadListPrec :: ReadPrec [ResetNetworkInterfaceAttributeResponse]
readPrec :: ReadPrec ResetNetworkInterfaceAttributeResponse
$creadPrec :: ReadPrec ResetNetworkInterfaceAttributeResponse
readList :: ReadS [ResetNetworkInterfaceAttributeResponse]
$creadList :: ReadS [ResetNetworkInterfaceAttributeResponse]
readsPrec :: Int -> ReadS ResetNetworkInterfaceAttributeResponse
$creadsPrec :: Int -> ReadS ResetNetworkInterfaceAttributeResponse
Prelude.Read, Int -> ResetNetworkInterfaceAttributeResponse -> ShowS
[ResetNetworkInterfaceAttributeResponse] -> ShowS
ResetNetworkInterfaceAttributeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetNetworkInterfaceAttributeResponse] -> ShowS
$cshowList :: [ResetNetworkInterfaceAttributeResponse] -> ShowS
show :: ResetNetworkInterfaceAttributeResponse -> String
$cshow :: ResetNetworkInterfaceAttributeResponse -> String
showsPrec :: Int -> ResetNetworkInterfaceAttributeResponse -> ShowS
$cshowsPrec :: Int -> ResetNetworkInterfaceAttributeResponse -> ShowS
Prelude.Show, forall x.
Rep ResetNetworkInterfaceAttributeResponse x
-> ResetNetworkInterfaceAttributeResponse
forall x.
ResetNetworkInterfaceAttributeResponse
-> Rep ResetNetworkInterfaceAttributeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResetNetworkInterfaceAttributeResponse x
-> ResetNetworkInterfaceAttributeResponse
$cfrom :: forall x.
ResetNetworkInterfaceAttributeResponse
-> Rep ResetNetworkInterfaceAttributeResponse x
Prelude.Generic)

-- |
-- Create a value of 'ResetNetworkInterfaceAttributeResponse' 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.
newResetNetworkInterfaceAttributeResponse ::
  ResetNetworkInterfaceAttributeResponse
newResetNetworkInterfaceAttributeResponse :: ResetNetworkInterfaceAttributeResponse
newResetNetworkInterfaceAttributeResponse =
  ResetNetworkInterfaceAttributeResponse
ResetNetworkInterfaceAttributeResponse'

instance
  Prelude.NFData
    ResetNetworkInterfaceAttributeResponse
  where
  rnf :: ResetNetworkInterfaceAttributeResponse -> ()
rnf ResetNetworkInterfaceAttributeResponse
_ = ()