{-# 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.Redshift.Types.SupportedOperation
-- 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.Redshift.Types.SupportedOperation where

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

-- | Describes the operations that are allowed on a maintenance track.
--
-- /See:/ 'newSupportedOperation' smart constructor.
data SupportedOperation = SupportedOperation'
  { -- | A list of the supported operations.
    SupportedOperation -> Maybe Text
operationName :: Prelude.Maybe Prelude.Text
  }
  deriving (SupportedOperation -> SupportedOperation -> Bool
(SupportedOperation -> SupportedOperation -> Bool)
-> (SupportedOperation -> SupportedOperation -> Bool)
-> Eq SupportedOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SupportedOperation -> SupportedOperation -> Bool
$c/= :: SupportedOperation -> SupportedOperation -> Bool
== :: SupportedOperation -> SupportedOperation -> Bool
$c== :: SupportedOperation -> SupportedOperation -> Bool
Prelude.Eq, ReadPrec [SupportedOperation]
ReadPrec SupportedOperation
Int -> ReadS SupportedOperation
ReadS [SupportedOperation]
(Int -> ReadS SupportedOperation)
-> ReadS [SupportedOperation]
-> ReadPrec SupportedOperation
-> ReadPrec [SupportedOperation]
-> Read SupportedOperation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SupportedOperation]
$creadListPrec :: ReadPrec [SupportedOperation]
readPrec :: ReadPrec SupportedOperation
$creadPrec :: ReadPrec SupportedOperation
readList :: ReadS [SupportedOperation]
$creadList :: ReadS [SupportedOperation]
readsPrec :: Int -> ReadS SupportedOperation
$creadsPrec :: Int -> ReadS SupportedOperation
Prelude.Read, Int -> SupportedOperation -> ShowS
[SupportedOperation] -> ShowS
SupportedOperation -> String
(Int -> SupportedOperation -> ShowS)
-> (SupportedOperation -> String)
-> ([SupportedOperation] -> ShowS)
-> Show SupportedOperation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SupportedOperation] -> ShowS
$cshowList :: [SupportedOperation] -> ShowS
show :: SupportedOperation -> String
$cshow :: SupportedOperation -> String
showsPrec :: Int -> SupportedOperation -> ShowS
$cshowsPrec :: Int -> SupportedOperation -> ShowS
Prelude.Show, (forall x. SupportedOperation -> Rep SupportedOperation x)
-> (forall x. Rep SupportedOperation x -> SupportedOperation)
-> Generic SupportedOperation
forall x. Rep SupportedOperation x -> SupportedOperation
forall x. SupportedOperation -> Rep SupportedOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SupportedOperation x -> SupportedOperation
$cfrom :: forall x. SupportedOperation -> Rep SupportedOperation x
Prelude.Generic)

-- |
-- Create a value of 'SupportedOperation' 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:
--
-- 'operationName', 'supportedOperation_operationName' - A list of the supported operations.
newSupportedOperation ::
  SupportedOperation
newSupportedOperation :: SupportedOperation
newSupportedOperation =
  SupportedOperation' :: Maybe Text -> SupportedOperation
SupportedOperation'
    { $sel:operationName:SupportedOperation' :: Maybe Text
operationName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of the supported operations.
supportedOperation_operationName :: Lens.Lens' SupportedOperation (Prelude.Maybe Prelude.Text)
supportedOperation_operationName :: (Maybe Text -> f (Maybe Text))
-> SupportedOperation -> f SupportedOperation
supportedOperation_operationName = (SupportedOperation -> Maybe Text)
-> (SupportedOperation -> Maybe Text -> SupportedOperation)
-> Lens
     SupportedOperation SupportedOperation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedOperation' {Maybe Text
operationName :: Maybe Text
$sel:operationName:SupportedOperation' :: SupportedOperation -> Maybe Text
operationName} -> Maybe Text
operationName) (\s :: SupportedOperation
s@SupportedOperation' {} Maybe Text
a -> SupportedOperation
s {$sel:operationName:SupportedOperation' :: Maybe Text
operationName = Maybe Text
a} :: SupportedOperation)

instance Core.FromXML SupportedOperation where
  parseXML :: [Node] -> Either String SupportedOperation
parseXML [Node]
x =
    Maybe Text -> SupportedOperation
SupportedOperation'
      (Maybe Text -> SupportedOperation)
-> Either String (Maybe Text) -> Either String SupportedOperation
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OperationName")

instance Prelude.Hashable SupportedOperation

instance Prelude.NFData SupportedOperation