{-# 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.DirectConnect.UpdateDirectConnectGatewayAssociation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the specified attributes of the Direct Connect gateway
-- association.
--
-- Add or remove prefixes from the association.
module Amazonka.DirectConnect.UpdateDirectConnectGatewayAssociation
  ( -- * Creating a Request
    UpdateDirectConnectGatewayAssociation (..),
    newUpdateDirectConnectGatewayAssociation,

    -- * Request Lenses
    updateDirectConnectGatewayAssociation_associationId,
    updateDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway,
    updateDirectConnectGatewayAssociation_removeAllowedPrefixesToDirectConnectGateway,

    -- * Destructuring the Response
    UpdateDirectConnectGatewayAssociationResponse (..),
    newUpdateDirectConnectGatewayAssociationResponse,

    -- * Response Lenses
    updateDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation,
    updateDirectConnectGatewayAssociationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateDirectConnectGatewayAssociation' smart constructor.
data UpdateDirectConnectGatewayAssociation = UpdateDirectConnectGatewayAssociation'
  { -- | The ID of the Direct Connect gateway association.
    UpdateDirectConnectGatewayAssociation -> Maybe Text
associationId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
    UpdateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix],
    -- | The Amazon VPC prefixes to no longer advertise to the Direct Connect
    -- gateway.
    UpdateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway :: Prelude.Maybe [RouteFilterPrefix]
  }
  deriving (UpdateDirectConnectGatewayAssociation
-> UpdateDirectConnectGatewayAssociation -> Bool
(UpdateDirectConnectGatewayAssociation
 -> UpdateDirectConnectGatewayAssociation -> Bool)
-> (UpdateDirectConnectGatewayAssociation
    -> UpdateDirectConnectGatewayAssociation -> Bool)
-> Eq UpdateDirectConnectGatewayAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDirectConnectGatewayAssociation
-> UpdateDirectConnectGatewayAssociation -> Bool
$c/= :: UpdateDirectConnectGatewayAssociation
-> UpdateDirectConnectGatewayAssociation -> Bool
== :: UpdateDirectConnectGatewayAssociation
-> UpdateDirectConnectGatewayAssociation -> Bool
$c== :: UpdateDirectConnectGatewayAssociation
-> UpdateDirectConnectGatewayAssociation -> Bool
Prelude.Eq, ReadPrec [UpdateDirectConnectGatewayAssociation]
ReadPrec UpdateDirectConnectGatewayAssociation
Int -> ReadS UpdateDirectConnectGatewayAssociation
ReadS [UpdateDirectConnectGatewayAssociation]
(Int -> ReadS UpdateDirectConnectGatewayAssociation)
-> ReadS [UpdateDirectConnectGatewayAssociation]
-> ReadPrec UpdateDirectConnectGatewayAssociation
-> ReadPrec [UpdateDirectConnectGatewayAssociation]
-> Read UpdateDirectConnectGatewayAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDirectConnectGatewayAssociation]
$creadListPrec :: ReadPrec [UpdateDirectConnectGatewayAssociation]
readPrec :: ReadPrec UpdateDirectConnectGatewayAssociation
$creadPrec :: ReadPrec UpdateDirectConnectGatewayAssociation
readList :: ReadS [UpdateDirectConnectGatewayAssociation]
$creadList :: ReadS [UpdateDirectConnectGatewayAssociation]
readsPrec :: Int -> ReadS UpdateDirectConnectGatewayAssociation
$creadsPrec :: Int -> ReadS UpdateDirectConnectGatewayAssociation
Prelude.Read, Int -> UpdateDirectConnectGatewayAssociation -> ShowS
[UpdateDirectConnectGatewayAssociation] -> ShowS
UpdateDirectConnectGatewayAssociation -> String
(Int -> UpdateDirectConnectGatewayAssociation -> ShowS)
-> (UpdateDirectConnectGatewayAssociation -> String)
-> ([UpdateDirectConnectGatewayAssociation] -> ShowS)
-> Show UpdateDirectConnectGatewayAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDirectConnectGatewayAssociation] -> ShowS
$cshowList :: [UpdateDirectConnectGatewayAssociation] -> ShowS
show :: UpdateDirectConnectGatewayAssociation -> String
$cshow :: UpdateDirectConnectGatewayAssociation -> String
showsPrec :: Int -> UpdateDirectConnectGatewayAssociation -> ShowS
$cshowsPrec :: Int -> UpdateDirectConnectGatewayAssociation -> ShowS
Prelude.Show, (forall x.
 UpdateDirectConnectGatewayAssociation
 -> Rep UpdateDirectConnectGatewayAssociation x)
-> (forall x.
    Rep UpdateDirectConnectGatewayAssociation x
    -> UpdateDirectConnectGatewayAssociation)
-> Generic UpdateDirectConnectGatewayAssociation
forall x.
Rep UpdateDirectConnectGatewayAssociation x
-> UpdateDirectConnectGatewayAssociation
forall x.
UpdateDirectConnectGatewayAssociation
-> Rep UpdateDirectConnectGatewayAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDirectConnectGatewayAssociation x
-> UpdateDirectConnectGatewayAssociation
$cfrom :: forall x.
UpdateDirectConnectGatewayAssociation
-> Rep UpdateDirectConnectGatewayAssociation x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDirectConnectGatewayAssociation' 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:
--
-- 'associationId', 'updateDirectConnectGatewayAssociation_associationId' - The ID of the Direct Connect gateway association.
--
-- 'addAllowedPrefixesToDirectConnectGateway', 'updateDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to advertise to the Direct Connect gateway.
--
-- 'removeAllowedPrefixesToDirectConnectGateway', 'updateDirectConnectGatewayAssociation_removeAllowedPrefixesToDirectConnectGateway' - The Amazon VPC prefixes to no longer advertise to the Direct Connect
-- gateway.
newUpdateDirectConnectGatewayAssociation ::
  UpdateDirectConnectGatewayAssociation
newUpdateDirectConnectGatewayAssociation :: UpdateDirectConnectGatewayAssociation
newUpdateDirectConnectGatewayAssociation =
  UpdateDirectConnectGatewayAssociation' :: Maybe Text
-> Maybe [RouteFilterPrefix]
-> Maybe [RouteFilterPrefix]
-> UpdateDirectConnectGatewayAssociation
UpdateDirectConnectGatewayAssociation'
    { $sel:associationId:UpdateDirectConnectGatewayAssociation' :: Maybe Text
associationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:addAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway =
        Maybe [RouteFilterPrefix]
forall a. Maybe a
Prelude.Nothing,
      $sel:removeAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway =
        Maybe [RouteFilterPrefix]
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Direct Connect gateway association.
updateDirectConnectGatewayAssociation_associationId :: Lens.Lens' UpdateDirectConnectGatewayAssociation (Prelude.Maybe Prelude.Text)
updateDirectConnectGatewayAssociation_associationId :: (Maybe Text -> f (Maybe Text))
-> UpdateDirectConnectGatewayAssociation
-> f UpdateDirectConnectGatewayAssociation
updateDirectConnectGatewayAssociation_associationId = (UpdateDirectConnectGatewayAssociation -> Maybe Text)
-> (UpdateDirectConnectGatewayAssociation
    -> Maybe Text -> UpdateDirectConnectGatewayAssociation)
-> Lens
     UpdateDirectConnectGatewayAssociation
     UpdateDirectConnectGatewayAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDirectConnectGatewayAssociation' {Maybe Text
associationId :: Maybe Text
$sel:associationId:UpdateDirectConnectGatewayAssociation' :: UpdateDirectConnectGatewayAssociation -> Maybe Text
associationId} -> Maybe Text
associationId) (\s :: UpdateDirectConnectGatewayAssociation
s@UpdateDirectConnectGatewayAssociation' {} Maybe Text
a -> UpdateDirectConnectGatewayAssociation
s {$sel:associationId:UpdateDirectConnectGatewayAssociation' :: Maybe Text
associationId = Maybe Text
a} :: UpdateDirectConnectGatewayAssociation)

-- | The Amazon VPC prefixes to advertise to the Direct Connect gateway.
updateDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway :: Lens.Lens' UpdateDirectConnectGatewayAssociation (Prelude.Maybe [RouteFilterPrefix])
updateDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> UpdateDirectConnectGatewayAssociation
-> f UpdateDirectConnectGatewayAssociation
updateDirectConnectGatewayAssociation_addAllowedPrefixesToDirectConnectGateway = (UpdateDirectConnectGatewayAssociation
 -> Maybe [RouteFilterPrefix])
-> (UpdateDirectConnectGatewayAssociation
    -> Maybe [RouteFilterPrefix]
    -> UpdateDirectConnectGatewayAssociation)
-> Lens
     UpdateDirectConnectGatewayAssociation
     UpdateDirectConnectGatewayAssociation
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: UpdateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway} -> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway) (\s :: UpdateDirectConnectGatewayAssociation
s@UpdateDirectConnectGatewayAssociation' {} Maybe [RouteFilterPrefix]
a -> UpdateDirectConnectGatewayAssociation
s {$sel:addAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway = Maybe [RouteFilterPrefix]
a} :: UpdateDirectConnectGatewayAssociation) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> UpdateDirectConnectGatewayAssociation
 -> f UpdateDirectConnectGatewayAssociation)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> UpdateDirectConnectGatewayAssociation
-> f UpdateDirectConnectGatewayAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
-> Iso
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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 AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon VPC prefixes to no longer advertise to the Direct Connect
-- gateway.
updateDirectConnectGatewayAssociation_removeAllowedPrefixesToDirectConnectGateway :: Lens.Lens' UpdateDirectConnectGatewayAssociation (Prelude.Maybe [RouteFilterPrefix])
updateDirectConnectGatewayAssociation_removeAllowedPrefixesToDirectConnectGateway :: (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> UpdateDirectConnectGatewayAssociation
-> f UpdateDirectConnectGatewayAssociation
updateDirectConnectGatewayAssociation_removeAllowedPrefixesToDirectConnectGateway = (UpdateDirectConnectGatewayAssociation
 -> Maybe [RouteFilterPrefix])
-> (UpdateDirectConnectGatewayAssociation
    -> Maybe [RouteFilterPrefix]
    -> UpdateDirectConnectGatewayAssociation)
-> Lens
     UpdateDirectConnectGatewayAssociation
     UpdateDirectConnectGatewayAssociation
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
$sel:removeAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: UpdateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway} -> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway) (\s :: UpdateDirectConnectGatewayAssociation
s@UpdateDirectConnectGatewayAssociation' {} Maybe [RouteFilterPrefix]
a -> UpdateDirectConnectGatewayAssociation
s {$sel:removeAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway = Maybe [RouteFilterPrefix]
a} :: UpdateDirectConnectGatewayAssociation) ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
 -> UpdateDirectConnectGatewayAssociation
 -> f UpdateDirectConnectGatewayAssociation)
-> ((Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
    -> Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> (Maybe [RouteFilterPrefix] -> f (Maybe [RouteFilterPrefix]))
-> UpdateDirectConnectGatewayAssociation
-> f UpdateDirectConnectGatewayAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
-> Iso
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
     (Maybe [RouteFilterPrefix])
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 AnIso
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
  [RouteFilterPrefix]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    UpdateDirectConnectGatewayAssociation
  where
  type
    AWSResponse
      UpdateDirectConnectGatewayAssociation =
      UpdateDirectConnectGatewayAssociationResponse
  request :: UpdateDirectConnectGatewayAssociation
-> Request UpdateDirectConnectGatewayAssociation
request = Service
-> UpdateDirectConnectGatewayAssociation
-> Request UpdateDirectConnectGatewayAssociation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateDirectConnectGatewayAssociation
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateDirectConnectGatewayAssociation)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse UpdateDirectConnectGatewayAssociation))
-> Logger
-> Service
-> Proxy UpdateDirectConnectGatewayAssociation
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse UpdateDirectConnectGatewayAssociation)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe DirectConnectGatewayAssociation
-> Int -> UpdateDirectConnectGatewayAssociationResponse
UpdateDirectConnectGatewayAssociationResponse'
            (Maybe DirectConnectGatewayAssociation
 -> Int -> UpdateDirectConnectGatewayAssociationResponse)
-> Either String (Maybe DirectConnectGatewayAssociation)
-> Either
     String (Int -> UpdateDirectConnectGatewayAssociationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe DirectConnectGatewayAssociation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"directConnectGatewayAssociation")
              Either
  String (Int -> UpdateDirectConnectGatewayAssociationResponse)
-> Either String Int
-> Either String UpdateDirectConnectGatewayAssociationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    UpdateDirectConnectGatewayAssociation

instance
  Prelude.NFData
    UpdateDirectConnectGatewayAssociation

instance
  Core.ToHeaders
    UpdateDirectConnectGatewayAssociation
  where
  toHeaders :: UpdateDirectConnectGatewayAssociation -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> UpdateDirectConnectGatewayAssociation -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OvertureService.UpdateDirectConnectGatewayAssociation" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    UpdateDirectConnectGatewayAssociation
  where
  toJSON :: UpdateDirectConnectGatewayAssociation -> Value
toJSON UpdateDirectConnectGatewayAssociation' {Maybe [RouteFilterPrefix]
Maybe Text
removeAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway :: Maybe [RouteFilterPrefix]
associationId :: Maybe Text
$sel:removeAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: UpdateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
$sel:addAllowedPrefixesToDirectConnectGateway:UpdateDirectConnectGatewayAssociation' :: UpdateDirectConnectGatewayAssociation -> Maybe [RouteFilterPrefix]
$sel:associationId:UpdateDirectConnectGatewayAssociation' :: UpdateDirectConnectGatewayAssociation -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"associationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
associationId,
            (Text
"addAllowedPrefixesToDirectConnectGateway" Text -> [RouteFilterPrefix] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([RouteFilterPrefix] -> Pair)
-> Maybe [RouteFilterPrefix] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteFilterPrefix]
addAllowedPrefixesToDirectConnectGateway,
            ( Text
"removeAllowedPrefixesToDirectConnectGateway"
                Text -> [RouteFilterPrefix] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=
            )
              ([RouteFilterPrefix] -> Pair)
-> Maybe [RouteFilterPrefix] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [RouteFilterPrefix]
removeAllowedPrefixesToDirectConnectGateway
          ]
      )

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

instance
  Core.ToQuery
    UpdateDirectConnectGatewayAssociation
  where
  toQuery :: UpdateDirectConnectGatewayAssociation -> QueryString
toQuery = QueryString -> UpdateDirectConnectGatewayAssociation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

-- |
-- Create a value of 'UpdateDirectConnectGatewayAssociationResponse' 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:
--
-- 'directConnectGatewayAssociation', 'updateDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation' - Undocumented member.
--
-- 'httpStatus', 'updateDirectConnectGatewayAssociationResponse_httpStatus' - The response's http status code.
newUpdateDirectConnectGatewayAssociationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateDirectConnectGatewayAssociationResponse
newUpdateDirectConnectGatewayAssociationResponse :: Int -> UpdateDirectConnectGatewayAssociationResponse
newUpdateDirectConnectGatewayAssociationResponse
  Int
pHttpStatus_ =
    UpdateDirectConnectGatewayAssociationResponse' :: Maybe DirectConnectGatewayAssociation
-> Int -> UpdateDirectConnectGatewayAssociationResponse
UpdateDirectConnectGatewayAssociationResponse'
      { $sel:directConnectGatewayAssociation:UpdateDirectConnectGatewayAssociationResponse' :: Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation =
          Maybe DirectConnectGatewayAssociation
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:UpdateDirectConnectGatewayAssociationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Undocumented member.
updateDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation :: Lens.Lens' UpdateDirectConnectGatewayAssociationResponse (Prelude.Maybe DirectConnectGatewayAssociation)
updateDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation :: (Maybe DirectConnectGatewayAssociation
 -> f (Maybe DirectConnectGatewayAssociation))
-> UpdateDirectConnectGatewayAssociationResponse
-> f UpdateDirectConnectGatewayAssociationResponse
updateDirectConnectGatewayAssociationResponse_directConnectGatewayAssociation = (UpdateDirectConnectGatewayAssociationResponse
 -> Maybe DirectConnectGatewayAssociation)
-> (UpdateDirectConnectGatewayAssociationResponse
    -> Maybe DirectConnectGatewayAssociation
    -> UpdateDirectConnectGatewayAssociationResponse)
-> Lens
     UpdateDirectConnectGatewayAssociationResponse
     UpdateDirectConnectGatewayAssociationResponse
     (Maybe DirectConnectGatewayAssociation)
     (Maybe DirectConnectGatewayAssociation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDirectConnectGatewayAssociationResponse' {Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation :: Maybe DirectConnectGatewayAssociation
$sel:directConnectGatewayAssociation:UpdateDirectConnectGatewayAssociationResponse' :: UpdateDirectConnectGatewayAssociationResponse
-> Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation} -> Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation) (\s :: UpdateDirectConnectGatewayAssociationResponse
s@UpdateDirectConnectGatewayAssociationResponse' {} Maybe DirectConnectGatewayAssociation
a -> UpdateDirectConnectGatewayAssociationResponse
s {$sel:directConnectGatewayAssociation:UpdateDirectConnectGatewayAssociationResponse' :: Maybe DirectConnectGatewayAssociation
directConnectGatewayAssociation = Maybe DirectConnectGatewayAssociation
a} :: UpdateDirectConnectGatewayAssociationResponse)

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

instance
  Prelude.NFData
    UpdateDirectConnectGatewayAssociationResponse