{-# 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.CreateCollectionDetail
-- 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.CreateCollectionDetail 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 Amazonka.OpenSearchServerless.Types.CollectionType
import qualified Amazonka.Prelude as Prelude

-- | Details about the created OpenSearch Serverless collection.
--
-- /See:/ 'newCreateCollectionDetail' smart constructor.
data CreateCollectionDetail = CreateCollectionDetail'
  { -- | The Amazon Resource Name (ARN) of the collection.
    CreateCollectionDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The Epoch time when the collection was created.
    CreateCollectionDetail -> Maybe Integer
createdDate :: Prelude.Maybe Prelude.Integer,
    -- | A description of the collection.
    CreateCollectionDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the collection.
    CreateCollectionDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the KMS key with which to encrypt the
    -- collection.
    CreateCollectionDetail -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the collection was last modified.
    CreateCollectionDetail -> Maybe Integer
lastModifiedDate :: Prelude.Maybe Prelude.Integer,
    -- | The name of the collection.
    CreateCollectionDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current status of the collection.
    CreateCollectionDetail -> Maybe CollectionStatus
status :: Prelude.Maybe CollectionStatus,
    -- | The type of collection.
    CreateCollectionDetail -> Maybe CollectionType
type' :: Prelude.Maybe CollectionType
  }
  deriving (CreateCollectionDetail -> CreateCollectionDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCollectionDetail -> CreateCollectionDetail -> Bool
$c/= :: CreateCollectionDetail -> CreateCollectionDetail -> Bool
== :: CreateCollectionDetail -> CreateCollectionDetail -> Bool
$c== :: CreateCollectionDetail -> CreateCollectionDetail -> Bool
Prelude.Eq, ReadPrec [CreateCollectionDetail]
ReadPrec CreateCollectionDetail
Int -> ReadS CreateCollectionDetail
ReadS [CreateCollectionDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCollectionDetail]
$creadListPrec :: ReadPrec [CreateCollectionDetail]
readPrec :: ReadPrec CreateCollectionDetail
$creadPrec :: ReadPrec CreateCollectionDetail
readList :: ReadS [CreateCollectionDetail]
$creadList :: ReadS [CreateCollectionDetail]
readsPrec :: Int -> ReadS CreateCollectionDetail
$creadsPrec :: Int -> ReadS CreateCollectionDetail
Prelude.Read, Int -> CreateCollectionDetail -> ShowS
[CreateCollectionDetail] -> ShowS
CreateCollectionDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCollectionDetail] -> ShowS
$cshowList :: [CreateCollectionDetail] -> ShowS
show :: CreateCollectionDetail -> String
$cshow :: CreateCollectionDetail -> String
showsPrec :: Int -> CreateCollectionDetail -> ShowS
$cshowsPrec :: Int -> CreateCollectionDetail -> ShowS
Prelude.Show, forall x. Rep CreateCollectionDetail x -> CreateCollectionDetail
forall x. CreateCollectionDetail -> Rep CreateCollectionDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCollectionDetail x -> CreateCollectionDetail
$cfrom :: forall x. CreateCollectionDetail -> Rep CreateCollectionDetail x
Prelude.Generic)

-- |
-- Create a value of 'CreateCollectionDetail' 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:
--
-- 'arn', 'createCollectionDetail_arn' - The Amazon Resource Name (ARN) of the collection.
--
-- 'createdDate', 'createCollectionDetail_createdDate' - The Epoch time when the collection was created.
--
-- 'description', 'createCollectionDetail_description' - A description of the collection.
--
-- 'id', 'createCollectionDetail_id' - The unique identifier of the collection.
--
-- 'kmsKeyArn', 'createCollectionDetail_kmsKeyArn' - The Amazon Resource Name (ARN) of the KMS key with which to encrypt the
-- collection.
--
-- 'lastModifiedDate', 'createCollectionDetail_lastModifiedDate' - The date and time when the collection was last modified.
--
-- 'name', 'createCollectionDetail_name' - The name of the collection.
--
-- 'status', 'createCollectionDetail_status' - The current status of the collection.
--
-- 'type'', 'createCollectionDetail_type' - The type of collection.
newCreateCollectionDetail ::
  CreateCollectionDetail
newCreateCollectionDetail :: CreateCollectionDetail
newCreateCollectionDetail =
  CreateCollectionDetail'
    { $sel:arn:CreateCollectionDetail' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:CreateCollectionDetail' :: Maybe Integer
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateCollectionDetail' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateCollectionDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyArn:CreateCollectionDetail' :: Maybe Text
kmsKeyArn = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:CreateCollectionDetail' :: Maybe Integer
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateCollectionDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:CreateCollectionDetail' :: Maybe CollectionStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:type':CreateCollectionDetail' :: Maybe CollectionType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the collection.
createCollectionDetail_arn :: Lens.Lens' CreateCollectionDetail (Prelude.Maybe Prelude.Text)
createCollectionDetail_arn :: Lens' CreateCollectionDetail (Maybe Text)
createCollectionDetail_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCollectionDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateCollectionDetail
s@CreateCollectionDetail' {} Maybe Text
a -> CreateCollectionDetail
s {$sel:arn:CreateCollectionDetail' :: Maybe Text
arn = Maybe Text
a} :: CreateCollectionDetail)

-- | The Epoch time when the collection was created.
createCollectionDetail_createdDate :: Lens.Lens' CreateCollectionDetail (Prelude.Maybe Prelude.Integer)
createCollectionDetail_createdDate :: Lens' CreateCollectionDetail (Maybe Integer)
createCollectionDetail_createdDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCollectionDetail' {Maybe Integer
createdDate :: Maybe Integer
$sel:createdDate:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Integer
createdDate} -> Maybe Integer
createdDate) (\s :: CreateCollectionDetail
s@CreateCollectionDetail' {} Maybe Integer
a -> CreateCollectionDetail
s {$sel:createdDate:CreateCollectionDetail' :: Maybe Integer
createdDate = Maybe Integer
a} :: CreateCollectionDetail)

-- | A description of the collection.
createCollectionDetail_description :: Lens.Lens' CreateCollectionDetail (Prelude.Maybe Prelude.Text)
createCollectionDetail_description :: Lens' CreateCollectionDetail (Maybe Text)
createCollectionDetail_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCollectionDetail' {Maybe Text
description :: Maybe Text
$sel:description:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateCollectionDetail
s@CreateCollectionDetail' {} Maybe Text
a -> CreateCollectionDetail
s {$sel:description:CreateCollectionDetail' :: Maybe Text
description = Maybe Text
a} :: CreateCollectionDetail)

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

-- | The Amazon Resource Name (ARN) of the KMS key with which to encrypt the
-- collection.
createCollectionDetail_kmsKeyArn :: Lens.Lens' CreateCollectionDetail (Prelude.Maybe Prelude.Text)
createCollectionDetail_kmsKeyArn :: Lens' CreateCollectionDetail (Maybe Text)
createCollectionDetail_kmsKeyArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCollectionDetail' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: CreateCollectionDetail
s@CreateCollectionDetail' {} Maybe Text
a -> CreateCollectionDetail
s {$sel:kmsKeyArn:CreateCollectionDetail' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: CreateCollectionDetail)

-- | The date and time when the collection was last modified.
createCollectionDetail_lastModifiedDate :: Lens.Lens' CreateCollectionDetail (Prelude.Maybe Prelude.Integer)
createCollectionDetail_lastModifiedDate :: Lens' CreateCollectionDetail (Maybe Integer)
createCollectionDetail_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCollectionDetail' {Maybe Integer
lastModifiedDate :: Maybe Integer
$sel:lastModifiedDate:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Integer
lastModifiedDate} -> Maybe Integer
lastModifiedDate) (\s :: CreateCollectionDetail
s@CreateCollectionDetail' {} Maybe Integer
a -> CreateCollectionDetail
s {$sel:lastModifiedDate:CreateCollectionDetail' :: Maybe Integer
lastModifiedDate = Maybe Integer
a} :: CreateCollectionDetail)

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

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

-- | The type of collection.
createCollectionDetail_type :: Lens.Lens' CreateCollectionDetail (Prelude.Maybe CollectionType)
createCollectionDetail_type :: Lens' CreateCollectionDetail (Maybe CollectionType)
createCollectionDetail_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCollectionDetail' {Maybe CollectionType
type' :: Maybe CollectionType
$sel:type':CreateCollectionDetail' :: CreateCollectionDetail -> Maybe CollectionType
type'} -> Maybe CollectionType
type') (\s :: CreateCollectionDetail
s@CreateCollectionDetail' {} Maybe CollectionType
a -> CreateCollectionDetail
s {$sel:type':CreateCollectionDetail' :: Maybe CollectionType
type' = Maybe CollectionType
a} :: CreateCollectionDetail)

instance Data.FromJSON CreateCollectionDetail where
  parseJSON :: Value -> Parser CreateCollectionDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CreateCollectionDetail"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe CollectionStatus
-> Maybe CollectionType
-> CreateCollectionDetail
CreateCollectionDetail'
            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
"arn")
            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
"createdDate")
            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
"description")
            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
"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
"kmsKeyArn")
            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
"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
"type")
      )

instance Prelude.Hashable CreateCollectionDetail where
  hashWithSalt :: Int -> CreateCollectionDetail -> Int
hashWithSalt Int
_salt CreateCollectionDetail' {Maybe Integer
Maybe Text
Maybe CollectionStatus
Maybe CollectionType
type' :: Maybe CollectionType
status :: Maybe CollectionStatus
name :: Maybe Text
lastModifiedDate :: Maybe Integer
kmsKeyArn :: Maybe Text
id :: Maybe Text
description :: Maybe Text
createdDate :: Maybe Integer
arn :: Maybe Text
$sel:type':CreateCollectionDetail' :: CreateCollectionDetail -> Maybe CollectionType
$sel:status:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe CollectionStatus
$sel:name:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:lastModifiedDate:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Integer
$sel:kmsKeyArn:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:id:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:description:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:createdDate:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Integer
$sel:arn:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
createdDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyArn
      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 CollectionStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CollectionType
type'

instance Prelude.NFData CreateCollectionDetail where
  rnf :: CreateCollectionDetail -> ()
rnf CreateCollectionDetail' {Maybe Integer
Maybe Text
Maybe CollectionStatus
Maybe CollectionType
type' :: Maybe CollectionType
status :: Maybe CollectionStatus
name :: Maybe Text
lastModifiedDate :: Maybe Integer
kmsKeyArn :: Maybe Text
id :: Maybe Text
description :: Maybe Text
createdDate :: Maybe Integer
arn :: Maybe Text
$sel:type':CreateCollectionDetail' :: CreateCollectionDetail -> Maybe CollectionType
$sel:status:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe CollectionStatus
$sel:name:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:lastModifiedDate:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Integer
$sel:kmsKeyArn:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:id:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:description:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
$sel:createdDate:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Integer
$sel:arn:CreateCollectionDetail' :: CreateCollectionDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
createdDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
kmsKeyArn
      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 CollectionStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CollectionType
type'