{-# 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.NetworkManager.CreateVpcAttachment
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a VPC attachment on an edge location of a core network.
module Amazonka.NetworkManager.CreateVpcAttachment
  ( -- * Creating a Request
    CreateVpcAttachment (..),
    newCreateVpcAttachment,

    -- * Request Lenses
    createVpcAttachment_clientToken,
    createVpcAttachment_options,
    createVpcAttachment_tags,
    createVpcAttachment_coreNetworkId,
    createVpcAttachment_vpcArn,
    createVpcAttachment_subnetArns,

    -- * Destructuring the Response
    CreateVpcAttachmentResponse (..),
    newCreateVpcAttachmentResponse,

    -- * Response Lenses
    createVpcAttachmentResponse_vpcAttachment,
    createVpcAttachmentResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateVpcAttachment' smart constructor.
data CreateVpcAttachment = CreateVpcAttachment'
  { -- | The client token associated with the request.
    CreateVpcAttachment -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Options for the VPC attachment.
    CreateVpcAttachment -> Maybe VpcOptions
options :: Prelude.Maybe VpcOptions,
    -- | The key-value tags associated with the request.
    CreateVpcAttachment -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The ID of a core network for the VPC attachment.
    CreateVpcAttachment -> Text
coreNetworkId :: Prelude.Text,
    -- | The ARN of the VPC.
    CreateVpcAttachment -> Text
vpcArn :: Prelude.Text,
    -- | The subnet ARN of the VPC attachment.
    CreateVpcAttachment -> [Text]
subnetArns :: [Prelude.Text]
  }
  deriving (CreateVpcAttachment -> CreateVpcAttachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcAttachment -> CreateVpcAttachment -> Bool
$c/= :: CreateVpcAttachment -> CreateVpcAttachment -> Bool
== :: CreateVpcAttachment -> CreateVpcAttachment -> Bool
$c== :: CreateVpcAttachment -> CreateVpcAttachment -> Bool
Prelude.Eq, ReadPrec [CreateVpcAttachment]
ReadPrec CreateVpcAttachment
Int -> ReadS CreateVpcAttachment
ReadS [CreateVpcAttachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcAttachment]
$creadListPrec :: ReadPrec [CreateVpcAttachment]
readPrec :: ReadPrec CreateVpcAttachment
$creadPrec :: ReadPrec CreateVpcAttachment
readList :: ReadS [CreateVpcAttachment]
$creadList :: ReadS [CreateVpcAttachment]
readsPrec :: Int -> ReadS CreateVpcAttachment
$creadsPrec :: Int -> ReadS CreateVpcAttachment
Prelude.Read, Int -> CreateVpcAttachment -> ShowS
[CreateVpcAttachment] -> ShowS
CreateVpcAttachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcAttachment] -> ShowS
$cshowList :: [CreateVpcAttachment] -> ShowS
show :: CreateVpcAttachment -> String
$cshow :: CreateVpcAttachment -> String
showsPrec :: Int -> CreateVpcAttachment -> ShowS
$cshowsPrec :: Int -> CreateVpcAttachment -> ShowS
Prelude.Show, forall x. Rep CreateVpcAttachment x -> CreateVpcAttachment
forall x. CreateVpcAttachment -> Rep CreateVpcAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVpcAttachment x -> CreateVpcAttachment
$cfrom :: forall x. CreateVpcAttachment -> Rep CreateVpcAttachment x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcAttachment' 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:
--
-- 'clientToken', 'createVpcAttachment_clientToken' - The client token associated with the request.
--
-- 'options', 'createVpcAttachment_options' - Options for the VPC attachment.
--
-- 'tags', 'createVpcAttachment_tags' - The key-value tags associated with the request.
--
-- 'coreNetworkId', 'createVpcAttachment_coreNetworkId' - The ID of a core network for the VPC attachment.
--
-- 'vpcArn', 'createVpcAttachment_vpcArn' - The ARN of the VPC.
--
-- 'subnetArns', 'createVpcAttachment_subnetArns' - The subnet ARN of the VPC attachment.
newCreateVpcAttachment ::
  -- | 'coreNetworkId'
  Prelude.Text ->
  -- | 'vpcArn'
  Prelude.Text ->
  CreateVpcAttachment
newCreateVpcAttachment :: Text -> Text -> CreateVpcAttachment
newCreateVpcAttachment Text
pCoreNetworkId_ Text
pVpcArn_ =
  CreateVpcAttachment'
    { $sel:clientToken:CreateVpcAttachment' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:options:CreateVpcAttachment' :: Maybe VpcOptions
options = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateVpcAttachment' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:coreNetworkId:CreateVpcAttachment' :: Text
coreNetworkId = Text
pCoreNetworkId_,
      $sel:vpcArn:CreateVpcAttachment' :: Text
vpcArn = Text
pVpcArn_,
      $sel:subnetArns:CreateVpcAttachment' :: [Text]
subnetArns = forall a. Monoid a => a
Prelude.mempty
    }

-- | The client token associated with the request.
createVpcAttachment_clientToken :: Lens.Lens' CreateVpcAttachment (Prelude.Maybe Prelude.Text)
createVpcAttachment_clientToken :: Lens' CreateVpcAttachment (Maybe Text)
createVpcAttachment_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachment' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateVpcAttachment
s@CreateVpcAttachment' {} Maybe Text
a -> CreateVpcAttachment
s {$sel:clientToken:CreateVpcAttachment' :: Maybe Text
clientToken = Maybe Text
a} :: CreateVpcAttachment)

-- | Options for the VPC attachment.
createVpcAttachment_options :: Lens.Lens' CreateVpcAttachment (Prelude.Maybe VpcOptions)
createVpcAttachment_options :: Lens' CreateVpcAttachment (Maybe VpcOptions)
createVpcAttachment_options = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachment' {Maybe VpcOptions
options :: Maybe VpcOptions
$sel:options:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe VpcOptions
options} -> Maybe VpcOptions
options) (\s :: CreateVpcAttachment
s@CreateVpcAttachment' {} Maybe VpcOptions
a -> CreateVpcAttachment
s {$sel:options:CreateVpcAttachment' :: Maybe VpcOptions
options = Maybe VpcOptions
a} :: CreateVpcAttachment)

-- | The key-value tags associated with the request.
createVpcAttachment_tags :: Lens.Lens' CreateVpcAttachment (Prelude.Maybe [Tag])
createVpcAttachment_tags :: Lens' CreateVpcAttachment (Maybe [Tag])
createVpcAttachment_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachment' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateVpcAttachment
s@CreateVpcAttachment' {} Maybe [Tag]
a -> CreateVpcAttachment
s {$sel:tags:CreateVpcAttachment' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateVpcAttachment) 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 ID of a core network for the VPC attachment.
createVpcAttachment_coreNetworkId :: Lens.Lens' CreateVpcAttachment Prelude.Text
createVpcAttachment_coreNetworkId :: Lens' CreateVpcAttachment Text
createVpcAttachment_coreNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachment' {Text
coreNetworkId :: Text
$sel:coreNetworkId:CreateVpcAttachment' :: CreateVpcAttachment -> Text
coreNetworkId} -> Text
coreNetworkId) (\s :: CreateVpcAttachment
s@CreateVpcAttachment' {} Text
a -> CreateVpcAttachment
s {$sel:coreNetworkId:CreateVpcAttachment' :: Text
coreNetworkId = Text
a} :: CreateVpcAttachment)

-- | The ARN of the VPC.
createVpcAttachment_vpcArn :: Lens.Lens' CreateVpcAttachment Prelude.Text
createVpcAttachment_vpcArn :: Lens' CreateVpcAttachment Text
createVpcAttachment_vpcArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachment' {Text
vpcArn :: Text
$sel:vpcArn:CreateVpcAttachment' :: CreateVpcAttachment -> Text
vpcArn} -> Text
vpcArn) (\s :: CreateVpcAttachment
s@CreateVpcAttachment' {} Text
a -> CreateVpcAttachment
s {$sel:vpcArn:CreateVpcAttachment' :: Text
vpcArn = Text
a} :: CreateVpcAttachment)

-- | The subnet ARN of the VPC attachment.
createVpcAttachment_subnetArns :: Lens.Lens' CreateVpcAttachment [Prelude.Text]
createVpcAttachment_subnetArns :: Lens' CreateVpcAttachment [Text]
createVpcAttachment_subnetArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachment' {[Text]
subnetArns :: [Text]
$sel:subnetArns:CreateVpcAttachment' :: CreateVpcAttachment -> [Text]
subnetArns} -> [Text]
subnetArns) (\s :: CreateVpcAttachment
s@CreateVpcAttachment' {} [Text]
a -> CreateVpcAttachment
s {$sel:subnetArns:CreateVpcAttachment' :: [Text]
subnetArns = [Text]
a} :: CreateVpcAttachment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateVpcAttachment where
  type
    AWSResponse CreateVpcAttachment =
      CreateVpcAttachmentResponse
  request :: (Service -> Service)
-> CreateVpcAttachment -> Request CreateVpcAttachment
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateVpcAttachment
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateVpcAttachment)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe VpcAttachment -> Int -> CreateVpcAttachmentResponse
CreateVpcAttachmentResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"VpcAttachment")
            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 CreateVpcAttachment where
  hashWithSalt :: Int -> CreateVpcAttachment -> Int
hashWithSalt Int
_salt CreateVpcAttachment' {[Text]
Maybe [Tag]
Maybe Text
Maybe VpcOptions
Text
subnetArns :: [Text]
vpcArn :: Text
coreNetworkId :: Text
tags :: Maybe [Tag]
options :: Maybe VpcOptions
clientToken :: Maybe Text
$sel:subnetArns:CreateVpcAttachment' :: CreateVpcAttachment -> [Text]
$sel:vpcArn:CreateVpcAttachment' :: CreateVpcAttachment -> Text
$sel:coreNetworkId:CreateVpcAttachment' :: CreateVpcAttachment -> Text
$sel:tags:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe [Tag]
$sel:options:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe VpcOptions
$sel:clientToken:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcOptions
options
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
coreNetworkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
subnetArns

instance Prelude.NFData CreateVpcAttachment where
  rnf :: CreateVpcAttachment -> ()
rnf CreateVpcAttachment' {[Text]
Maybe [Tag]
Maybe Text
Maybe VpcOptions
Text
subnetArns :: [Text]
vpcArn :: Text
coreNetworkId :: Text
tags :: Maybe [Tag]
options :: Maybe VpcOptions
clientToken :: Maybe Text
$sel:subnetArns:CreateVpcAttachment' :: CreateVpcAttachment -> [Text]
$sel:vpcArn:CreateVpcAttachment' :: CreateVpcAttachment -> Text
$sel:coreNetworkId:CreateVpcAttachment' :: CreateVpcAttachment -> Text
$sel:tags:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe [Tag]
$sel:options:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe VpcOptions
$sel:clientToken:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcOptions
options
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
coreNetworkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
subnetArns

instance Data.ToHeaders CreateVpcAttachment where
  toHeaders :: CreateVpcAttachment -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateVpcAttachment where
  toJSON :: CreateVpcAttachment -> Value
toJSON CreateVpcAttachment' {[Text]
Maybe [Tag]
Maybe Text
Maybe VpcOptions
Text
subnetArns :: [Text]
vpcArn :: Text
coreNetworkId :: Text
tags :: Maybe [Tag]
options :: Maybe VpcOptions
clientToken :: Maybe Text
$sel:subnetArns:CreateVpcAttachment' :: CreateVpcAttachment -> [Text]
$sel:vpcArn:CreateVpcAttachment' :: CreateVpcAttachment -> Text
$sel:coreNetworkId:CreateVpcAttachment' :: CreateVpcAttachment -> Text
$sel:tags:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe [Tag]
$sel:options:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe VpcOptions
$sel:clientToken:CreateVpcAttachment' :: CreateVpcAttachment -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ClientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"Options" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcOptions
options,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"CoreNetworkId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
coreNetworkId),
            forall a. a -> Maybe a
Prelude.Just (Key
"VpcArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vpcArn),
            forall a. a -> Maybe a
Prelude.Just (Key
"SubnetArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
subnetArns)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateVpcAttachmentResponse' 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:
--
-- 'vpcAttachment', 'createVpcAttachmentResponse_vpcAttachment' - Provides details about the VPC attachment.
--
-- 'httpStatus', 'createVpcAttachmentResponse_httpStatus' - The response's http status code.
newCreateVpcAttachmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateVpcAttachmentResponse
newCreateVpcAttachmentResponse :: Int -> CreateVpcAttachmentResponse
newCreateVpcAttachmentResponse Int
pHttpStatus_ =
  CreateVpcAttachmentResponse'
    { $sel:vpcAttachment:CreateVpcAttachmentResponse' :: Maybe VpcAttachment
vpcAttachment =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateVpcAttachmentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Provides details about the VPC attachment.
createVpcAttachmentResponse_vpcAttachment :: Lens.Lens' CreateVpcAttachmentResponse (Prelude.Maybe VpcAttachment)
createVpcAttachmentResponse_vpcAttachment :: Lens' CreateVpcAttachmentResponse (Maybe VpcAttachment)
createVpcAttachmentResponse_vpcAttachment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcAttachmentResponse' {Maybe VpcAttachment
vpcAttachment :: Maybe VpcAttachment
$sel:vpcAttachment:CreateVpcAttachmentResponse' :: CreateVpcAttachmentResponse -> Maybe VpcAttachment
vpcAttachment} -> Maybe VpcAttachment
vpcAttachment) (\s :: CreateVpcAttachmentResponse
s@CreateVpcAttachmentResponse' {} Maybe VpcAttachment
a -> CreateVpcAttachmentResponse
s {$sel:vpcAttachment:CreateVpcAttachmentResponse' :: Maybe VpcAttachment
vpcAttachment = Maybe VpcAttachment
a} :: CreateVpcAttachmentResponse)

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

instance Prelude.NFData CreateVpcAttachmentResponse where
  rnf :: CreateVpcAttachmentResponse -> ()
rnf CreateVpcAttachmentResponse' {Int
Maybe VpcAttachment
httpStatus :: Int
vpcAttachment :: Maybe VpcAttachment
$sel:httpStatus:CreateVpcAttachmentResponse' :: CreateVpcAttachmentResponse -> Int
$sel:vpcAttachment:CreateVpcAttachmentResponse' :: CreateVpcAttachmentResponse -> Maybe VpcAttachment
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcAttachment
vpcAttachment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus