{-# 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.UpdateCollectionDetail
-- 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.UpdateCollectionDetail 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 an updated OpenSearch Serverless collection.
--
-- /See:/ 'newUpdateCollectionDetail' smart constructor.
data UpdateCollectionDetail = UpdateCollectionDetail'
  { -- | The Amazon Resource Name (ARN) of the collection.
    UpdateCollectionDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the collection was created.
    UpdateCollectionDetail -> Maybe Integer
createdDate :: Prelude.Maybe Prelude.Integer,
    -- | The description of the collection.
    UpdateCollectionDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the collection.
    UpdateCollectionDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the collection was last modified.
    UpdateCollectionDetail -> Maybe Integer
lastModifiedDate :: Prelude.Maybe Prelude.Integer,
    -- | The name of the collection.
    UpdateCollectionDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current status of the collection.
    UpdateCollectionDetail -> Maybe CollectionStatus
status :: Prelude.Maybe CollectionStatus,
    -- | The collection type.
    UpdateCollectionDetail -> Maybe CollectionType
type' :: Prelude.Maybe CollectionType
  }
  deriving (UpdateCollectionDetail -> UpdateCollectionDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCollectionDetail -> UpdateCollectionDetail -> Bool
$c/= :: UpdateCollectionDetail -> UpdateCollectionDetail -> Bool
== :: UpdateCollectionDetail -> UpdateCollectionDetail -> Bool
$c== :: UpdateCollectionDetail -> UpdateCollectionDetail -> Bool
Prelude.Eq, ReadPrec [UpdateCollectionDetail]
ReadPrec UpdateCollectionDetail
Int -> ReadS UpdateCollectionDetail
ReadS [UpdateCollectionDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCollectionDetail]
$creadListPrec :: ReadPrec [UpdateCollectionDetail]
readPrec :: ReadPrec UpdateCollectionDetail
$creadPrec :: ReadPrec UpdateCollectionDetail
readList :: ReadS [UpdateCollectionDetail]
$creadList :: ReadS [UpdateCollectionDetail]
readsPrec :: Int -> ReadS UpdateCollectionDetail
$creadsPrec :: Int -> ReadS UpdateCollectionDetail
Prelude.Read, Int -> UpdateCollectionDetail -> ShowS
[UpdateCollectionDetail] -> ShowS
UpdateCollectionDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCollectionDetail] -> ShowS
$cshowList :: [UpdateCollectionDetail] -> ShowS
show :: UpdateCollectionDetail -> String
$cshow :: UpdateCollectionDetail -> String
showsPrec :: Int -> UpdateCollectionDetail -> ShowS
$cshowsPrec :: Int -> UpdateCollectionDetail -> ShowS
Prelude.Show, forall x. Rep UpdateCollectionDetail x -> UpdateCollectionDetail
forall x. UpdateCollectionDetail -> Rep UpdateCollectionDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCollectionDetail x -> UpdateCollectionDetail
$cfrom :: forall x. UpdateCollectionDetail -> Rep UpdateCollectionDetail x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCollectionDetail' 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', 'updateCollectionDetail_arn' - The Amazon Resource Name (ARN) of the collection.
--
-- 'createdDate', 'updateCollectionDetail_createdDate' - The date and time when the collection was created.
--
-- 'description', 'updateCollectionDetail_description' - The description of the collection.
--
-- 'id', 'updateCollectionDetail_id' - The unique identifier of the collection.
--
-- 'lastModifiedDate', 'updateCollectionDetail_lastModifiedDate' - The date and time when the collection was last modified.
--
-- 'name', 'updateCollectionDetail_name' - The name of the collection.
--
-- 'status', 'updateCollectionDetail_status' - The current status of the collection.
--
-- 'type'', 'updateCollectionDetail_type' - The collection type.
newUpdateCollectionDetail ::
  UpdateCollectionDetail
newUpdateCollectionDetail :: UpdateCollectionDetail
newUpdateCollectionDetail =
  UpdateCollectionDetail'
    { $sel:arn:UpdateCollectionDetail' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:UpdateCollectionDetail' :: Maybe Integer
createdDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateCollectionDetail' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:UpdateCollectionDetail' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UpdateCollectionDetail' :: Maybe Integer
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateCollectionDetail' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateCollectionDetail' :: Maybe CollectionStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateCollectionDetail' :: Maybe CollectionType
type' = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

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

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

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

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