{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Redshift.Types.SupportedOperation 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
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
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]
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
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. 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'
    { $sel:operationName:SupportedOperation' :: Maybe Text
operationName =
        forall a. Maybe a
Prelude.Nothing
    }

-- | A list of the supported operations.
supportedOperation_operationName :: Lens.Lens' SupportedOperation (Prelude.Maybe Prelude.Text)
supportedOperation_operationName :: Lens' SupportedOperation (Maybe Text)
supportedOperation_operationName = 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 Data.FromXML SupportedOperation where
  parseXML :: [Node] -> Either String SupportedOperation
parseXML [Node]
x =
    Maybe Text -> SupportedOperation
SupportedOperation'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"OperationName")

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

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