{-# 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.SWF.Types.DomainConfiguration
-- 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.SWF.Types.DomainConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Contains the configuration settings of a domain.
--
-- /See:/ 'newDomainConfiguration' smart constructor.
data DomainConfiguration = DomainConfiguration'
  { -- | The retention period for workflow executions in this domain.
    DomainConfiguration -> Text
workflowExecutionRetentionPeriodInDays :: Prelude.Text
  }
  deriving (DomainConfiguration -> DomainConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainConfiguration -> DomainConfiguration -> Bool
$c/= :: DomainConfiguration -> DomainConfiguration -> Bool
== :: DomainConfiguration -> DomainConfiguration -> Bool
$c== :: DomainConfiguration -> DomainConfiguration -> Bool
Prelude.Eq, ReadPrec [DomainConfiguration]
ReadPrec DomainConfiguration
Int -> ReadS DomainConfiguration
ReadS [DomainConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainConfiguration]
$creadListPrec :: ReadPrec [DomainConfiguration]
readPrec :: ReadPrec DomainConfiguration
$creadPrec :: ReadPrec DomainConfiguration
readList :: ReadS [DomainConfiguration]
$creadList :: ReadS [DomainConfiguration]
readsPrec :: Int -> ReadS DomainConfiguration
$creadsPrec :: Int -> ReadS DomainConfiguration
Prelude.Read, Int -> DomainConfiguration -> ShowS
[DomainConfiguration] -> ShowS
DomainConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainConfiguration] -> ShowS
$cshowList :: [DomainConfiguration] -> ShowS
show :: DomainConfiguration -> String
$cshow :: DomainConfiguration -> String
showsPrec :: Int -> DomainConfiguration -> ShowS
$cshowsPrec :: Int -> DomainConfiguration -> ShowS
Prelude.Show, forall x. Rep DomainConfiguration x -> DomainConfiguration
forall x. DomainConfiguration -> Rep DomainConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainConfiguration x -> DomainConfiguration
$cfrom :: forall x. DomainConfiguration -> Rep DomainConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DomainConfiguration' 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:
--
-- 'workflowExecutionRetentionPeriodInDays', 'domainConfiguration_workflowExecutionRetentionPeriodInDays' - The retention period for workflow executions in this domain.
newDomainConfiguration ::
  -- | 'workflowExecutionRetentionPeriodInDays'
  Prelude.Text ->
  DomainConfiguration
newDomainConfiguration :: Text -> DomainConfiguration
newDomainConfiguration
  Text
pWorkflowExecutionRetentionPeriodInDays_ =
    DomainConfiguration'
      { $sel:workflowExecutionRetentionPeriodInDays:DomainConfiguration' :: Text
workflowExecutionRetentionPeriodInDays =
          Text
pWorkflowExecutionRetentionPeriodInDays_
      }

-- | The retention period for workflow executions in this domain.
domainConfiguration_workflowExecutionRetentionPeriodInDays :: Lens.Lens' DomainConfiguration Prelude.Text
domainConfiguration_workflowExecutionRetentionPeriodInDays :: Lens' DomainConfiguration Text
domainConfiguration_workflowExecutionRetentionPeriodInDays = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainConfiguration' {Text
workflowExecutionRetentionPeriodInDays :: Text
$sel:workflowExecutionRetentionPeriodInDays:DomainConfiguration' :: DomainConfiguration -> Text
workflowExecutionRetentionPeriodInDays} -> Text
workflowExecutionRetentionPeriodInDays) (\s :: DomainConfiguration
s@DomainConfiguration' {} Text
a -> DomainConfiguration
s {$sel:workflowExecutionRetentionPeriodInDays:DomainConfiguration' :: Text
workflowExecutionRetentionPeriodInDays = Text
a} :: DomainConfiguration)

instance Data.FromJSON DomainConfiguration where
  parseJSON :: Value -> Parser DomainConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DomainConfiguration"
      ( \Object
x ->
          Text -> DomainConfiguration
DomainConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"workflowExecutionRetentionPeriodInDays")
      )

instance Prelude.Hashable DomainConfiguration where
  hashWithSalt :: Int -> DomainConfiguration -> Int
hashWithSalt Int
_salt DomainConfiguration' {Text
workflowExecutionRetentionPeriodInDays :: Text
$sel:workflowExecutionRetentionPeriodInDays:DomainConfiguration' :: DomainConfiguration -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowExecutionRetentionPeriodInDays

instance Prelude.NFData DomainConfiguration where
  rnf :: DomainConfiguration -> ()
rnf DomainConfiguration' {Text
workflowExecutionRetentionPeriodInDays :: Text
$sel:workflowExecutionRetentionPeriodInDays:DomainConfiguration' :: DomainConfiguration -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
workflowExecutionRetentionPeriodInDays