{-# 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.CloudSearch.Types.DomainEndpointOptionsStatus
-- 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.CloudSearch.Types.DomainEndpointOptionsStatus where

import Amazonka.CloudSearch.Types.DomainEndpointOptions
import Amazonka.CloudSearch.Types.OptionStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The configuration and status of the domain\'s endpoint options.
--
-- /See:/ 'newDomainEndpointOptionsStatus' smart constructor.
data DomainEndpointOptionsStatus = DomainEndpointOptionsStatus'
  { -- | The domain endpoint options configured for the domain.
    DomainEndpointOptionsStatus -> DomainEndpointOptions
options :: DomainEndpointOptions,
    -- | The status of the configured domain endpoint options.
    DomainEndpointOptionsStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (DomainEndpointOptionsStatus -> DomainEndpointOptionsStatus -> Bool
(DomainEndpointOptionsStatus
 -> DomainEndpointOptionsStatus -> Bool)
-> (DomainEndpointOptionsStatus
    -> DomainEndpointOptionsStatus -> Bool)
-> Eq DomainEndpointOptionsStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainEndpointOptionsStatus -> DomainEndpointOptionsStatus -> Bool
$c/= :: DomainEndpointOptionsStatus -> DomainEndpointOptionsStatus -> Bool
== :: DomainEndpointOptionsStatus -> DomainEndpointOptionsStatus -> Bool
$c== :: DomainEndpointOptionsStatus -> DomainEndpointOptionsStatus -> Bool
Prelude.Eq, ReadPrec [DomainEndpointOptionsStatus]
ReadPrec DomainEndpointOptionsStatus
Int -> ReadS DomainEndpointOptionsStatus
ReadS [DomainEndpointOptionsStatus]
(Int -> ReadS DomainEndpointOptionsStatus)
-> ReadS [DomainEndpointOptionsStatus]
-> ReadPrec DomainEndpointOptionsStatus
-> ReadPrec [DomainEndpointOptionsStatus]
-> Read DomainEndpointOptionsStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainEndpointOptionsStatus]
$creadListPrec :: ReadPrec [DomainEndpointOptionsStatus]
readPrec :: ReadPrec DomainEndpointOptionsStatus
$creadPrec :: ReadPrec DomainEndpointOptionsStatus
readList :: ReadS [DomainEndpointOptionsStatus]
$creadList :: ReadS [DomainEndpointOptionsStatus]
readsPrec :: Int -> ReadS DomainEndpointOptionsStatus
$creadsPrec :: Int -> ReadS DomainEndpointOptionsStatus
Prelude.Read, Int -> DomainEndpointOptionsStatus -> ShowS
[DomainEndpointOptionsStatus] -> ShowS
DomainEndpointOptionsStatus -> String
(Int -> DomainEndpointOptionsStatus -> ShowS)
-> (DomainEndpointOptionsStatus -> String)
-> ([DomainEndpointOptionsStatus] -> ShowS)
-> Show DomainEndpointOptionsStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainEndpointOptionsStatus] -> ShowS
$cshowList :: [DomainEndpointOptionsStatus] -> ShowS
show :: DomainEndpointOptionsStatus -> String
$cshow :: DomainEndpointOptionsStatus -> String
showsPrec :: Int -> DomainEndpointOptionsStatus -> ShowS
$cshowsPrec :: Int -> DomainEndpointOptionsStatus -> ShowS
Prelude.Show, (forall x.
 DomainEndpointOptionsStatus -> Rep DomainEndpointOptionsStatus x)
-> (forall x.
    Rep DomainEndpointOptionsStatus x -> DomainEndpointOptionsStatus)
-> Generic DomainEndpointOptionsStatus
forall x.
Rep DomainEndpointOptionsStatus x -> DomainEndpointOptionsStatus
forall x.
DomainEndpointOptionsStatus -> Rep DomainEndpointOptionsStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DomainEndpointOptionsStatus x -> DomainEndpointOptionsStatus
$cfrom :: forall x.
DomainEndpointOptionsStatus -> Rep DomainEndpointOptionsStatus x
Prelude.Generic)

-- |
-- Create a value of 'DomainEndpointOptionsStatus' 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:
--
-- 'options', 'domainEndpointOptionsStatus_options' - The domain endpoint options configured for the domain.
--
-- 'status', 'domainEndpointOptionsStatus_status' - The status of the configured domain endpoint options.
newDomainEndpointOptionsStatus ::
  -- | 'options'
  DomainEndpointOptions ->
  -- | 'status'
  OptionStatus ->
  DomainEndpointOptionsStatus
newDomainEndpointOptionsStatus :: DomainEndpointOptions
-> OptionStatus -> DomainEndpointOptionsStatus
newDomainEndpointOptionsStatus DomainEndpointOptions
pOptions_ OptionStatus
pStatus_ =
  DomainEndpointOptionsStatus' :: DomainEndpointOptions
-> OptionStatus -> DomainEndpointOptionsStatus
DomainEndpointOptionsStatus'
    { $sel:options:DomainEndpointOptionsStatus' :: DomainEndpointOptions
options = DomainEndpointOptions
pOptions_,
      $sel:status:DomainEndpointOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | The domain endpoint options configured for the domain.
domainEndpointOptionsStatus_options :: Lens.Lens' DomainEndpointOptionsStatus DomainEndpointOptions
domainEndpointOptionsStatus_options :: (DomainEndpointOptions -> f DomainEndpointOptions)
-> DomainEndpointOptionsStatus -> f DomainEndpointOptionsStatus
domainEndpointOptionsStatus_options = (DomainEndpointOptionsStatus -> DomainEndpointOptions)
-> (DomainEndpointOptionsStatus
    -> DomainEndpointOptions -> DomainEndpointOptionsStatus)
-> Lens
     DomainEndpointOptionsStatus
     DomainEndpointOptionsStatus
     DomainEndpointOptions
     DomainEndpointOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEndpointOptionsStatus' {DomainEndpointOptions
options :: DomainEndpointOptions
$sel:options:DomainEndpointOptionsStatus' :: DomainEndpointOptionsStatus -> DomainEndpointOptions
options} -> DomainEndpointOptions
options) (\s :: DomainEndpointOptionsStatus
s@DomainEndpointOptionsStatus' {} DomainEndpointOptions
a -> DomainEndpointOptionsStatus
s {$sel:options:DomainEndpointOptionsStatus' :: DomainEndpointOptions
options = DomainEndpointOptions
a} :: DomainEndpointOptionsStatus)

-- | The status of the configured domain endpoint options.
domainEndpointOptionsStatus_status :: Lens.Lens' DomainEndpointOptionsStatus OptionStatus
domainEndpointOptionsStatus_status :: (OptionStatus -> f OptionStatus)
-> DomainEndpointOptionsStatus -> f DomainEndpointOptionsStatus
domainEndpointOptionsStatus_status = (DomainEndpointOptionsStatus -> OptionStatus)
-> (DomainEndpointOptionsStatus
    -> OptionStatus -> DomainEndpointOptionsStatus)
-> Lens
     DomainEndpointOptionsStatus
     DomainEndpointOptionsStatus
     OptionStatus
     OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEndpointOptionsStatus' {OptionStatus
status :: OptionStatus
$sel:status:DomainEndpointOptionsStatus' :: DomainEndpointOptionsStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: DomainEndpointOptionsStatus
s@DomainEndpointOptionsStatus' {} OptionStatus
a -> DomainEndpointOptionsStatus
s {$sel:status:DomainEndpointOptionsStatus' :: OptionStatus
status = OptionStatus
a} :: DomainEndpointOptionsStatus)

instance Core.FromXML DomainEndpointOptionsStatus where
  parseXML :: [Node] -> Either String DomainEndpointOptionsStatus
parseXML [Node]
x =
    DomainEndpointOptions
-> OptionStatus -> DomainEndpointOptionsStatus
DomainEndpointOptionsStatus'
      (DomainEndpointOptions
 -> OptionStatus -> DomainEndpointOptionsStatus)
-> Either String DomainEndpointOptions
-> Either String (OptionStatus -> DomainEndpointOptionsStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String DomainEndpointOptions
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Options")
      Either String (OptionStatus -> DomainEndpointOptionsStatus)
-> Either String OptionStatus
-> Either String DomainEndpointOptionsStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String OptionStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")

instance Prelude.Hashable DomainEndpointOptionsStatus

instance Prelude.NFData DomainEndpointOptionsStatus