{-# 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.SecurityHub.Types.AwsRedshiftClusterResizeInfo
-- 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.SecurityHub.Types.AwsRedshiftClusterResizeInfo where

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

-- | Information about the resize operation for the cluster.
--
-- /See:/ 'newAwsRedshiftClusterResizeInfo' smart constructor.
data AwsRedshiftClusterResizeInfo = AwsRedshiftClusterResizeInfo'
  { -- | Indicates whether the resize operation can be canceled.
    AwsRedshiftClusterResizeInfo -> Maybe Bool
allowCancelResize :: Prelude.Maybe Prelude.Bool,
    -- | The type of resize operation.
    --
    -- Valid values: @ClassicResize@
    AwsRedshiftClusterResizeInfo -> Maybe Text
resizeType :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsRedshiftClusterResizeInfo
-> AwsRedshiftClusterResizeInfo -> Bool
(AwsRedshiftClusterResizeInfo
 -> AwsRedshiftClusterResizeInfo -> Bool)
-> (AwsRedshiftClusterResizeInfo
    -> AwsRedshiftClusterResizeInfo -> Bool)
-> Eq AwsRedshiftClusterResizeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsRedshiftClusterResizeInfo
-> AwsRedshiftClusterResizeInfo -> Bool
$c/= :: AwsRedshiftClusterResizeInfo
-> AwsRedshiftClusterResizeInfo -> Bool
== :: AwsRedshiftClusterResizeInfo
-> AwsRedshiftClusterResizeInfo -> Bool
$c== :: AwsRedshiftClusterResizeInfo
-> AwsRedshiftClusterResizeInfo -> Bool
Prelude.Eq, ReadPrec [AwsRedshiftClusterResizeInfo]
ReadPrec AwsRedshiftClusterResizeInfo
Int -> ReadS AwsRedshiftClusterResizeInfo
ReadS [AwsRedshiftClusterResizeInfo]
(Int -> ReadS AwsRedshiftClusterResizeInfo)
-> ReadS [AwsRedshiftClusterResizeInfo]
-> ReadPrec AwsRedshiftClusterResizeInfo
-> ReadPrec [AwsRedshiftClusterResizeInfo]
-> Read AwsRedshiftClusterResizeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsRedshiftClusterResizeInfo]
$creadListPrec :: ReadPrec [AwsRedshiftClusterResizeInfo]
readPrec :: ReadPrec AwsRedshiftClusterResizeInfo
$creadPrec :: ReadPrec AwsRedshiftClusterResizeInfo
readList :: ReadS [AwsRedshiftClusterResizeInfo]
$creadList :: ReadS [AwsRedshiftClusterResizeInfo]
readsPrec :: Int -> ReadS AwsRedshiftClusterResizeInfo
$creadsPrec :: Int -> ReadS AwsRedshiftClusterResizeInfo
Prelude.Read, Int -> AwsRedshiftClusterResizeInfo -> ShowS
[AwsRedshiftClusterResizeInfo] -> ShowS
AwsRedshiftClusterResizeInfo -> String
(Int -> AwsRedshiftClusterResizeInfo -> ShowS)
-> (AwsRedshiftClusterResizeInfo -> String)
-> ([AwsRedshiftClusterResizeInfo] -> ShowS)
-> Show AwsRedshiftClusterResizeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsRedshiftClusterResizeInfo] -> ShowS
$cshowList :: [AwsRedshiftClusterResizeInfo] -> ShowS
show :: AwsRedshiftClusterResizeInfo -> String
$cshow :: AwsRedshiftClusterResizeInfo -> String
showsPrec :: Int -> AwsRedshiftClusterResizeInfo -> ShowS
$cshowsPrec :: Int -> AwsRedshiftClusterResizeInfo -> ShowS
Prelude.Show, (forall x.
 AwsRedshiftClusterResizeInfo -> Rep AwsRedshiftClusterResizeInfo x)
-> (forall x.
    Rep AwsRedshiftClusterResizeInfo x -> AwsRedshiftClusterResizeInfo)
-> Generic AwsRedshiftClusterResizeInfo
forall x.
Rep AwsRedshiftClusterResizeInfo x -> AwsRedshiftClusterResizeInfo
forall x.
AwsRedshiftClusterResizeInfo -> Rep AwsRedshiftClusterResizeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsRedshiftClusterResizeInfo x -> AwsRedshiftClusterResizeInfo
$cfrom :: forall x.
AwsRedshiftClusterResizeInfo -> Rep AwsRedshiftClusterResizeInfo x
Prelude.Generic)

-- |
-- Create a value of 'AwsRedshiftClusterResizeInfo' 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:
--
-- 'allowCancelResize', 'awsRedshiftClusterResizeInfo_allowCancelResize' - Indicates whether the resize operation can be canceled.
--
-- 'resizeType', 'awsRedshiftClusterResizeInfo_resizeType' - The type of resize operation.
--
-- Valid values: @ClassicResize@
newAwsRedshiftClusterResizeInfo ::
  AwsRedshiftClusterResizeInfo
newAwsRedshiftClusterResizeInfo :: AwsRedshiftClusterResizeInfo
newAwsRedshiftClusterResizeInfo =
  AwsRedshiftClusterResizeInfo' :: Maybe Bool -> Maybe Text -> AwsRedshiftClusterResizeInfo
AwsRedshiftClusterResizeInfo'
    { $sel:allowCancelResize:AwsRedshiftClusterResizeInfo' :: Maybe Bool
allowCancelResize =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:resizeType:AwsRedshiftClusterResizeInfo' :: Maybe Text
resizeType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the resize operation can be canceled.
awsRedshiftClusterResizeInfo_allowCancelResize :: Lens.Lens' AwsRedshiftClusterResizeInfo (Prelude.Maybe Prelude.Bool)
awsRedshiftClusterResizeInfo_allowCancelResize :: (Maybe Bool -> f (Maybe Bool))
-> AwsRedshiftClusterResizeInfo -> f AwsRedshiftClusterResizeInfo
awsRedshiftClusterResizeInfo_allowCancelResize = (AwsRedshiftClusterResizeInfo -> Maybe Bool)
-> (AwsRedshiftClusterResizeInfo
    -> Maybe Bool -> AwsRedshiftClusterResizeInfo)
-> Lens
     AwsRedshiftClusterResizeInfo
     AwsRedshiftClusterResizeInfo
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterResizeInfo' {Maybe Bool
allowCancelResize :: Maybe Bool
$sel:allowCancelResize:AwsRedshiftClusterResizeInfo' :: AwsRedshiftClusterResizeInfo -> Maybe Bool
allowCancelResize} -> Maybe Bool
allowCancelResize) (\s :: AwsRedshiftClusterResizeInfo
s@AwsRedshiftClusterResizeInfo' {} Maybe Bool
a -> AwsRedshiftClusterResizeInfo
s {$sel:allowCancelResize:AwsRedshiftClusterResizeInfo' :: Maybe Bool
allowCancelResize = Maybe Bool
a} :: AwsRedshiftClusterResizeInfo)

-- | The type of resize operation.
--
-- Valid values: @ClassicResize@
awsRedshiftClusterResizeInfo_resizeType :: Lens.Lens' AwsRedshiftClusterResizeInfo (Prelude.Maybe Prelude.Text)
awsRedshiftClusterResizeInfo_resizeType :: (Maybe Text -> f (Maybe Text))
-> AwsRedshiftClusterResizeInfo -> f AwsRedshiftClusterResizeInfo
awsRedshiftClusterResizeInfo_resizeType = (AwsRedshiftClusterResizeInfo -> Maybe Text)
-> (AwsRedshiftClusterResizeInfo
    -> Maybe Text -> AwsRedshiftClusterResizeInfo)
-> Lens
     AwsRedshiftClusterResizeInfo
     AwsRedshiftClusterResizeInfo
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsRedshiftClusterResizeInfo' {Maybe Text
resizeType :: Maybe Text
$sel:resizeType:AwsRedshiftClusterResizeInfo' :: AwsRedshiftClusterResizeInfo -> Maybe Text
resizeType} -> Maybe Text
resizeType) (\s :: AwsRedshiftClusterResizeInfo
s@AwsRedshiftClusterResizeInfo' {} Maybe Text
a -> AwsRedshiftClusterResizeInfo
s {$sel:resizeType:AwsRedshiftClusterResizeInfo' :: Maybe Text
resizeType = Maybe Text
a} :: AwsRedshiftClusterResizeInfo)

instance Core.FromJSON AwsRedshiftClusterResizeInfo where
  parseJSON :: Value -> Parser AwsRedshiftClusterResizeInfo
parseJSON =
    String
-> (Object -> Parser AwsRedshiftClusterResizeInfo)
-> Value
-> Parser AwsRedshiftClusterResizeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsRedshiftClusterResizeInfo"
      ( \Object
x ->
          Maybe Bool -> Maybe Text -> AwsRedshiftClusterResizeInfo
AwsRedshiftClusterResizeInfo'
            (Maybe Bool -> Maybe Text -> AwsRedshiftClusterResizeInfo)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> AwsRedshiftClusterResizeInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AllowCancelResize")
            Parser (Maybe Text -> AwsRedshiftClusterResizeInfo)
-> Parser (Maybe Text) -> Parser AwsRedshiftClusterResizeInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResizeType")
      )

instance
  Prelude.Hashable
    AwsRedshiftClusterResizeInfo

instance Prelude.NFData AwsRedshiftClusterResizeInfo

instance Core.ToJSON AwsRedshiftClusterResizeInfo where
  toJSON :: AwsRedshiftClusterResizeInfo -> Value
toJSON AwsRedshiftClusterResizeInfo' {Maybe Bool
Maybe Text
resizeType :: Maybe Text
allowCancelResize :: Maybe Bool
$sel:resizeType:AwsRedshiftClusterResizeInfo' :: AwsRedshiftClusterResizeInfo -> Maybe Text
$sel:allowCancelResize:AwsRedshiftClusterResizeInfo' :: AwsRedshiftClusterResizeInfo -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AllowCancelResize" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
allowCancelResize,
            (Text
"ResizeType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resizeType
          ]
      )