{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.OpenSearchServerless.Types.CreateVpcEndpointDetail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.OpenSearchServerless.Types.CreateVpcEndpointDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearchServerless.Types.VpcEndpointStatus
import qualified Amazonka.Prelude as Prelude

-- | Creation details for an OpenSearch Serverless-managed interface
-- endpoint. For more information, see
-- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html Access Amazon OpenSearch Serverless using an interface endpoint>.
--
-- /See:/ 'newCreateVpcEndpointDetail' smart constructor.
data CreateVpcEndpointDetail = CreateVpcEndpointDetail'
  { -- | The unique identifier of the endpoint.
    CreateVpcEndpointDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the endpoint.
    CreateVpcEndpointDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current status in the endpoint creation process.
    CreateVpcEndpointDetail -> Maybe VpcEndpointStatus
status :: Prelude.Maybe VpcEndpointStatus
  }
  deriving (CreateVpcEndpointDetail -> CreateVpcEndpointDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpointDetail -> CreateVpcEndpointDetail -> Bool
$c/= :: CreateVpcEndpointDetail -> CreateVpcEndpointDetail -> Bool
== :: CreateVpcEndpointDetail -> CreateVpcEndpointDetail -> Bool
$c== :: CreateVpcEndpointDetail -> CreateVpcEndpointDetail -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpointDetail]
ReadPrec CreateVpcEndpointDetail
Int -> ReadS CreateVpcEndpointDetail
ReadS [CreateVpcEndpointDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpointDetail]
$creadListPrec :: ReadPrec [CreateVpcEndpointDetail]
readPrec :: ReadPrec CreateVpcEndpointDetail
$creadPrec :: ReadPrec CreateVpcEndpointDetail
readList :: ReadS [CreateVpcEndpointDetail]
$creadList :: ReadS [CreateVpcEndpointDetail]
readsPrec :: Int -> ReadS CreateVpcEndpointDetail
$creadsPrec :: Int -> ReadS CreateVpcEndpointDetail
Prelude.Read, Int -> CreateVpcEndpointDetail -> ShowS
[CreateVpcEndpointDetail] -> ShowS
CreateVpcEndpointDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpointDetail] -> ShowS
$cshowList :: [CreateVpcEndpointDetail] -> ShowS
show :: CreateVpcEndpointDetail -> String
$cshow :: CreateVpcEndpointDetail -> String
showsPrec :: Int -> CreateVpcEndpointDetail -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpointDetail -> ShowS
Prelude.Show, forall x. Rep CreateVpcEndpointDetail x -> CreateVpcEndpointDetail
forall x. CreateVpcEndpointDetail -> Rep CreateVpcEndpointDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVpcEndpointDetail x -> CreateVpcEndpointDetail
$cfrom :: forall x. CreateVpcEndpointDetail -> Rep CreateVpcEndpointDetail x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpointDetail' 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:
--
-- 'id', 'createVpcEndpointDetail_id' - The unique identifier of the endpoint.
--
-- 'name', 'createVpcEndpointDetail_name' - The name of the endpoint.
--
-- 'status', 'createVpcEndpointDetail_status' - The current status in the endpoint creation process.
newCreateVpcEndpointDetail ::
  CreateVpcEndpointDetail
newCreateVpcEndpointDetail :: CreateVpcEndpointDetail
newCreateVpcEndpointDetail =
  CreateVpcEndpointDetail'
    { $sel:id:CreateVpcEndpointDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateVpcEndpointDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateVpcEndpointDetail' :: Maybe VpcEndpointStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier of the endpoint.
createVpcEndpointDetail_id :: Lens.Lens' CreateVpcEndpointDetail (Prelude.Maybe Prelude.Text)
createVpcEndpointDetail_id :: Lens' CreateVpcEndpointDetail (Maybe Text)
createVpcEndpointDetail_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointDetail' {Maybe Text
id :: Maybe Text
$sel:id:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateVpcEndpointDetail
s@CreateVpcEndpointDetail' {} Maybe Text
a -> CreateVpcEndpointDetail
s {$sel:id:CreateVpcEndpointDetail' :: Maybe Text
id = Maybe Text
a} :: CreateVpcEndpointDetail)

-- | The name of the endpoint.
createVpcEndpointDetail_name :: Lens.Lens' CreateVpcEndpointDetail (Prelude.Maybe Prelude.Text)
createVpcEndpointDetail_name :: Lens' CreateVpcEndpointDetail (Maybe Text)
createVpcEndpointDetail_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointDetail' {Maybe Text
name :: Maybe Text
$sel:name:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateVpcEndpointDetail
s@CreateVpcEndpointDetail' {} Maybe Text
a -> CreateVpcEndpointDetail
s {$sel:name:CreateVpcEndpointDetail' :: Maybe Text
name = Maybe Text
a} :: CreateVpcEndpointDetail)

-- | The current status in the endpoint creation process.
createVpcEndpointDetail_status :: Lens.Lens' CreateVpcEndpointDetail (Prelude.Maybe VpcEndpointStatus)
createVpcEndpointDetail_status :: Lens' CreateVpcEndpointDetail (Maybe VpcEndpointStatus)
createVpcEndpointDetail_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointDetail' {Maybe VpcEndpointStatus
status :: Maybe VpcEndpointStatus
$sel:status:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe VpcEndpointStatus
status} -> Maybe VpcEndpointStatus
status) (\s :: CreateVpcEndpointDetail
s@CreateVpcEndpointDetail' {} Maybe VpcEndpointStatus
a -> CreateVpcEndpointDetail
s {$sel:status:CreateVpcEndpointDetail' :: Maybe VpcEndpointStatus
status = Maybe VpcEndpointStatus
a} :: CreateVpcEndpointDetail)

instance Data.FromJSON CreateVpcEndpointDetail where
  parseJSON :: Value -> Parser CreateVpcEndpointDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CreateVpcEndpointDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe VpcEndpointStatus -> CreateVpcEndpointDetail
CreateVpcEndpointDetail'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"status")
      )

instance Prelude.Hashable CreateVpcEndpointDetail where
  hashWithSalt :: Int -> CreateVpcEndpointDetail -> Int
hashWithSalt Int
_salt CreateVpcEndpointDetail' {Maybe Text
Maybe VpcEndpointStatus
status :: Maybe VpcEndpointStatus
name :: Maybe Text
id :: Maybe Text
$sel:status:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe VpcEndpointStatus
$sel:name:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe Text
$sel:id:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcEndpointStatus
status

instance Prelude.NFData CreateVpcEndpointDetail where
  rnf :: CreateVpcEndpointDetail -> ()
rnf CreateVpcEndpointDetail' {Maybe Text
Maybe VpcEndpointStatus
status :: Maybe VpcEndpointStatus
name :: Maybe Text
id :: Maybe Text
$sel:status:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe VpcEndpointStatus
$sel:name:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe Text
$sel:id:CreateVpcEndpointDetail' :: CreateVpcEndpointDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcEndpointStatus
status