{-# 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.UpdateVpcEndpointDetail
-- 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.UpdateVpcEndpointDetail 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

-- | Update details for an OpenSearch Serverless-managed interface endpoint.
--
-- /See:/ 'newUpdateVpcEndpointDetail' smart constructor.
data UpdateVpcEndpointDetail = UpdateVpcEndpointDetail'
  { -- | The unique identifier of the endpoint.
    UpdateVpcEndpointDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The timestamp of when the endpoint was last modified.
    UpdateVpcEndpointDetail -> Maybe Integer
lastModifiedDate :: Prelude.Maybe Prelude.Integer,
    -- | The name of the endpoint.
    UpdateVpcEndpointDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The unique identifiers of the security groups that define the ports,
    -- protocols, and sources for inbound traffic that you are authorizing into
    -- your endpoint.
    UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
securityGroupIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The current status of the endpoint update process.
    UpdateVpcEndpointDetail -> Maybe VpcEndpointStatus
status :: Prelude.Maybe VpcEndpointStatus,
    -- | The ID of the subnets from which you access OpenSearch Serverless.
    UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
subnetIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (UpdateVpcEndpointDetail -> UpdateVpcEndpointDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVpcEndpointDetail -> UpdateVpcEndpointDetail -> Bool
$c/= :: UpdateVpcEndpointDetail -> UpdateVpcEndpointDetail -> Bool
== :: UpdateVpcEndpointDetail -> UpdateVpcEndpointDetail -> Bool
$c== :: UpdateVpcEndpointDetail -> UpdateVpcEndpointDetail -> Bool
Prelude.Eq, ReadPrec [UpdateVpcEndpointDetail]
ReadPrec UpdateVpcEndpointDetail
Int -> ReadS UpdateVpcEndpointDetail
ReadS [UpdateVpcEndpointDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVpcEndpointDetail]
$creadListPrec :: ReadPrec [UpdateVpcEndpointDetail]
readPrec :: ReadPrec UpdateVpcEndpointDetail
$creadPrec :: ReadPrec UpdateVpcEndpointDetail
readList :: ReadS [UpdateVpcEndpointDetail]
$creadList :: ReadS [UpdateVpcEndpointDetail]
readsPrec :: Int -> ReadS UpdateVpcEndpointDetail
$creadsPrec :: Int -> ReadS UpdateVpcEndpointDetail
Prelude.Read, Int -> UpdateVpcEndpointDetail -> ShowS
[UpdateVpcEndpointDetail] -> ShowS
UpdateVpcEndpointDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVpcEndpointDetail] -> ShowS
$cshowList :: [UpdateVpcEndpointDetail] -> ShowS
show :: UpdateVpcEndpointDetail -> String
$cshow :: UpdateVpcEndpointDetail -> String
showsPrec :: Int -> UpdateVpcEndpointDetail -> ShowS
$cshowsPrec :: Int -> UpdateVpcEndpointDetail -> ShowS
Prelude.Show, forall x. Rep UpdateVpcEndpointDetail x -> UpdateVpcEndpointDetail
forall x. UpdateVpcEndpointDetail -> Rep UpdateVpcEndpointDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateVpcEndpointDetail x -> UpdateVpcEndpointDetail
$cfrom :: forall x. UpdateVpcEndpointDetail -> Rep UpdateVpcEndpointDetail x
Prelude.Generic)

-- |
-- Create a value of 'UpdateVpcEndpointDetail' 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', 'updateVpcEndpointDetail_id' - The unique identifier of the endpoint.
--
-- 'lastModifiedDate', 'updateVpcEndpointDetail_lastModifiedDate' - The timestamp of when the endpoint was last modified.
--
-- 'name', 'updateVpcEndpointDetail_name' - The name of the endpoint.
--
-- 'securityGroupIds', 'updateVpcEndpointDetail_securityGroupIds' - The unique identifiers of the security groups that define the ports,
-- protocols, and sources for inbound traffic that you are authorizing into
-- your endpoint.
--
-- 'status', 'updateVpcEndpointDetail_status' - The current status of the endpoint update process.
--
-- 'subnetIds', 'updateVpcEndpointDetail_subnetIds' - The ID of the subnets from which you access OpenSearch Serverless.
newUpdateVpcEndpointDetail ::
  UpdateVpcEndpointDetail
newUpdateVpcEndpointDetail :: UpdateVpcEndpointDetail
newUpdateVpcEndpointDetail =
  UpdateVpcEndpointDetail'
    { $sel:id:UpdateVpcEndpointDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UpdateVpcEndpointDetail' :: Maybe Integer
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateVpcEndpointDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:UpdateVpcEndpointDetail' :: Maybe (NonEmpty Text)
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateVpcEndpointDetail' :: Maybe VpcEndpointStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:UpdateVpcEndpointDetail' :: Maybe (NonEmpty Text)
subnetIds = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The timestamp of when the endpoint was last modified.
updateVpcEndpointDetail_lastModifiedDate :: Lens.Lens' UpdateVpcEndpointDetail (Prelude.Maybe Prelude.Integer)
updateVpcEndpointDetail_lastModifiedDate :: Lens' UpdateVpcEndpointDetail (Maybe Integer)
updateVpcEndpointDetail_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVpcEndpointDetail' {Maybe Integer
lastModifiedDate :: Maybe Integer
$sel:lastModifiedDate:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe Integer
lastModifiedDate} -> Maybe Integer
lastModifiedDate) (\s :: UpdateVpcEndpointDetail
s@UpdateVpcEndpointDetail' {} Maybe Integer
a -> UpdateVpcEndpointDetail
s {$sel:lastModifiedDate:UpdateVpcEndpointDetail' :: Maybe Integer
lastModifiedDate = Maybe Integer
a} :: UpdateVpcEndpointDetail)

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

-- | The unique identifiers of the security groups that define the ports,
-- protocols, and sources for inbound traffic that you are authorizing into
-- your endpoint.
updateVpcEndpointDetail_securityGroupIds :: Lens.Lens' UpdateVpcEndpointDetail (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateVpcEndpointDetail_securityGroupIds :: Lens' UpdateVpcEndpointDetail (Maybe (NonEmpty Text))
updateVpcEndpointDetail_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVpcEndpointDetail' {Maybe (NonEmpty Text)
securityGroupIds :: Maybe (NonEmpty Text)
$sel:securityGroupIds:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
securityGroupIds} -> Maybe (NonEmpty Text)
securityGroupIds) (\s :: UpdateVpcEndpointDetail
s@UpdateVpcEndpointDetail' {} Maybe (NonEmpty Text)
a -> UpdateVpcEndpointDetail
s {$sel:securityGroupIds:UpdateVpcEndpointDetail' :: Maybe (NonEmpty Text)
securityGroupIds = Maybe (NonEmpty Text)
a} :: UpdateVpcEndpointDetail) 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 current status of the endpoint update process.
updateVpcEndpointDetail_status :: Lens.Lens' UpdateVpcEndpointDetail (Prelude.Maybe VpcEndpointStatus)
updateVpcEndpointDetail_status :: Lens' UpdateVpcEndpointDetail (Maybe VpcEndpointStatus)
updateVpcEndpointDetail_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVpcEndpointDetail' {Maybe VpcEndpointStatus
status :: Maybe VpcEndpointStatus
$sel:status:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe VpcEndpointStatus
status} -> Maybe VpcEndpointStatus
status) (\s :: UpdateVpcEndpointDetail
s@UpdateVpcEndpointDetail' {} Maybe VpcEndpointStatus
a -> UpdateVpcEndpointDetail
s {$sel:status:UpdateVpcEndpointDetail' :: Maybe VpcEndpointStatus
status = Maybe VpcEndpointStatus
a} :: UpdateVpcEndpointDetail)

-- | The ID of the subnets from which you access OpenSearch Serverless.
updateVpcEndpointDetail_subnetIds :: Lens.Lens' UpdateVpcEndpointDetail (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateVpcEndpointDetail_subnetIds :: Lens' UpdateVpcEndpointDetail (Maybe (NonEmpty Text))
updateVpcEndpointDetail_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVpcEndpointDetail' {Maybe (NonEmpty Text)
subnetIds :: Maybe (NonEmpty Text)
$sel:subnetIds:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
subnetIds} -> Maybe (NonEmpty Text)
subnetIds) (\s :: UpdateVpcEndpointDetail
s@UpdateVpcEndpointDetail' {} Maybe (NonEmpty Text)
a -> UpdateVpcEndpointDetail
s {$sel:subnetIds:UpdateVpcEndpointDetail' :: Maybe (NonEmpty Text)
subnetIds = Maybe (NonEmpty Text)
a} :: UpdateVpcEndpointDetail) 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

instance Data.FromJSON UpdateVpcEndpointDetail where
  parseJSON :: Value -> Parser UpdateVpcEndpointDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UpdateVpcEndpointDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe VpcEndpointStatus
-> Maybe (NonEmpty Text)
-> UpdateVpcEndpointDetail
UpdateVpcEndpointDetail'
            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
"lastModifiedDate")
            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
"securityGroupIds")
            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")
            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
"subnetIds")
      )

instance Prelude.Hashable UpdateVpcEndpointDetail where
  hashWithSalt :: Int -> UpdateVpcEndpointDetail -> Int
hashWithSalt Int
_salt UpdateVpcEndpointDetail' {Maybe Integer
Maybe (NonEmpty Text)
Maybe Text
Maybe VpcEndpointStatus
subnetIds :: Maybe (NonEmpty Text)
status :: Maybe VpcEndpointStatus
securityGroupIds :: Maybe (NonEmpty Text)
name :: Maybe Text
lastModifiedDate :: Maybe Integer
id :: Maybe Text
$sel:subnetIds:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
$sel:status:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe VpcEndpointStatus
$sel:securityGroupIds:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
$sel:name:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe Text
$sel:lastModifiedDate:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe Integer
$sel:id:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> 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 Integer
lastModifiedDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpcEndpointStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
subnetIds

instance Prelude.NFData UpdateVpcEndpointDetail where
  rnf :: UpdateVpcEndpointDetail -> ()
rnf UpdateVpcEndpointDetail' {Maybe Integer
Maybe (NonEmpty Text)
Maybe Text
Maybe VpcEndpointStatus
subnetIds :: Maybe (NonEmpty Text)
status :: Maybe VpcEndpointStatus
securityGroupIds :: Maybe (NonEmpty Text)
name :: Maybe Text
lastModifiedDate :: Maybe Integer
id :: Maybe Text
$sel:subnetIds:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
$sel:status:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe VpcEndpointStatus
$sel:securityGroupIds:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe (NonEmpty Text)
$sel:name:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe Text
$sel:lastModifiedDate:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> Maybe Integer
$sel:id:UpdateVpcEndpointDetail' :: UpdateVpcEndpointDetail -> 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 Integer
lastModifiedDate
      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 (NonEmpty Text)
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpcEndpointStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
subnetIds