{-# 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.DeleteCollectionDetail
-- 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.DeleteCollectionDetail 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.CollectionStatus
import qualified Amazonka.Prelude as Prelude

-- | Details about a deleted OpenSearch Serverless collection.
--
-- /See:/ 'newDeleteCollectionDetail' smart constructor.
data DeleteCollectionDetail = DeleteCollectionDetail'
  { -- | The unique identifier of the collection.
    DeleteCollectionDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the collection.
    DeleteCollectionDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current status of the collection.
    DeleteCollectionDetail -> Maybe CollectionStatus
status :: Prelude.Maybe CollectionStatus
  }
  deriving (DeleteCollectionDetail -> DeleteCollectionDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCollectionDetail -> DeleteCollectionDetail -> Bool
$c/= :: DeleteCollectionDetail -> DeleteCollectionDetail -> Bool
== :: DeleteCollectionDetail -> DeleteCollectionDetail -> Bool
$c== :: DeleteCollectionDetail -> DeleteCollectionDetail -> Bool
Prelude.Eq, ReadPrec [DeleteCollectionDetail]
ReadPrec DeleteCollectionDetail
Int -> ReadS DeleteCollectionDetail
ReadS [DeleteCollectionDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCollectionDetail]
$creadListPrec :: ReadPrec [DeleteCollectionDetail]
readPrec :: ReadPrec DeleteCollectionDetail
$creadPrec :: ReadPrec DeleteCollectionDetail
readList :: ReadS [DeleteCollectionDetail]
$creadList :: ReadS [DeleteCollectionDetail]
readsPrec :: Int -> ReadS DeleteCollectionDetail
$creadsPrec :: Int -> ReadS DeleteCollectionDetail
Prelude.Read, Int -> DeleteCollectionDetail -> ShowS
[DeleteCollectionDetail] -> ShowS
DeleteCollectionDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCollectionDetail] -> ShowS
$cshowList :: [DeleteCollectionDetail] -> ShowS
show :: DeleteCollectionDetail -> String
$cshow :: DeleteCollectionDetail -> String
showsPrec :: Int -> DeleteCollectionDetail -> ShowS
$cshowsPrec :: Int -> DeleteCollectionDetail -> ShowS
Prelude.Show, forall x. Rep DeleteCollectionDetail x -> DeleteCollectionDetail
forall x. DeleteCollectionDetail -> Rep DeleteCollectionDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCollectionDetail x -> DeleteCollectionDetail
$cfrom :: forall x. DeleteCollectionDetail -> Rep DeleteCollectionDetail x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCollectionDetail' 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', 'deleteCollectionDetail_id' - The unique identifier of the collection.
--
-- 'name', 'deleteCollectionDetail_name' - The name of the collection.
--
-- 'status', 'deleteCollectionDetail_status' - The current status of the collection.
newDeleteCollectionDetail ::
  DeleteCollectionDetail
newDeleteCollectionDetail :: DeleteCollectionDetail
newDeleteCollectionDetail =
  DeleteCollectionDetail'
    { $sel:id:DeleteCollectionDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:DeleteCollectionDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:DeleteCollectionDetail' :: Maybe CollectionStatus
status = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The current status of the collection.
deleteCollectionDetail_status :: Lens.Lens' DeleteCollectionDetail (Prelude.Maybe CollectionStatus)
deleteCollectionDetail_status :: Lens' DeleteCollectionDetail (Maybe CollectionStatus)
deleteCollectionDetail_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCollectionDetail' {Maybe CollectionStatus
status :: Maybe CollectionStatus
$sel:status:DeleteCollectionDetail' :: DeleteCollectionDetail -> Maybe CollectionStatus
status} -> Maybe CollectionStatus
status) (\s :: DeleteCollectionDetail
s@DeleteCollectionDetail' {} Maybe CollectionStatus
a -> DeleteCollectionDetail
s {$sel:status:DeleteCollectionDetail' :: Maybe CollectionStatus
status = Maybe CollectionStatus
a} :: DeleteCollectionDetail)

instance Data.FromJSON DeleteCollectionDetail where
  parseJSON :: Value -> Parser DeleteCollectionDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DeleteCollectionDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe CollectionStatus -> DeleteCollectionDetail
DeleteCollectionDetail'
            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 DeleteCollectionDetail where
  hashWithSalt :: Int -> DeleteCollectionDetail -> Int
hashWithSalt Int
_salt DeleteCollectionDetail' {Maybe Text
Maybe CollectionStatus
status :: Maybe CollectionStatus
name :: Maybe Text
id :: Maybe Text
$sel:status:DeleteCollectionDetail' :: DeleteCollectionDetail -> Maybe CollectionStatus
$sel:name:DeleteCollectionDetail' :: DeleteCollectionDetail -> Maybe Text
$sel:id:DeleteCollectionDetail' :: DeleteCollectionDetail -> 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 CollectionStatus
status

instance Prelude.NFData DeleteCollectionDetail where
  rnf :: DeleteCollectionDetail -> ()
rnf DeleteCollectionDetail' {Maybe Text
Maybe CollectionStatus
status :: Maybe CollectionStatus
name :: Maybe Text
id :: Maybe Text
$sel:status:DeleteCollectionDetail' :: DeleteCollectionDetail -> Maybe CollectionStatus
$sel:name:DeleteCollectionDetail' :: DeleteCollectionDetail -> Maybe Text
$sel:id:DeleteCollectionDetail' :: DeleteCollectionDetail -> 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 CollectionStatus
status