{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SWF.Types.DomainConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(DomainConfiguration -> DomainConfiguration -> Bool)
-> (DomainConfiguration -> DomainConfiguration -> Bool)
-> Eq DomainConfiguration
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]
(Int -> ReadS DomainConfiguration)
-> ReadS [DomainConfiguration]
-> ReadPrec DomainConfiguration
-> ReadPrec [DomainConfiguration]
-> Read 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
(Int -> DomainConfiguration -> ShowS)
-> (DomainConfiguration -> String)
-> ([DomainConfiguration] -> ShowS)
-> Show DomainConfiguration
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. DomainConfiguration -> Rep DomainConfiguration x)
-> (forall x. Rep DomainConfiguration x -> DomainConfiguration)
-> Generic DomainConfiguration
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' :: Text -> DomainConfiguration
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 :: (Text -> f Text) -> DomainConfiguration -> f DomainConfiguration
domainConfiguration_workflowExecutionRetentionPeriodInDays = (DomainConfiguration -> Text)
-> (DomainConfiguration -> Text -> DomainConfiguration)
-> Lens DomainConfiguration DomainConfiguration Text Text
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 Core.FromJSON DomainConfiguration where
  parseJSON :: Value -> Parser DomainConfiguration
parseJSON =
    String
-> (Object -> Parser DomainConfiguration)
-> Value
-> Parser DomainConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainConfiguration"
      ( \Object
x ->
          Text -> DomainConfiguration
DomainConfiguration'
            (Text -> DomainConfiguration)
-> Parser Text -> Parser DomainConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"workflowExecutionRetentionPeriodInDays")
      )

instance Prelude.Hashable DomainConfiguration

instance Prelude.NFData DomainConfiguration