{-# 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.GuardDuty.Types.VolumeMount
-- 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.GuardDuty.Types.VolumeMount 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

-- | Container volume mount.
--
-- /See:/ 'newVolumeMount' smart constructor.
data VolumeMount = VolumeMount'
  { -- | Volume mount path.
    VolumeMount -> Maybe Text
mountPath :: Prelude.Maybe Prelude.Text,
    -- | Volume mount name.
    VolumeMount -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (VolumeMount -> VolumeMount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VolumeMount -> VolumeMount -> Bool
$c/= :: VolumeMount -> VolumeMount -> Bool
== :: VolumeMount -> VolumeMount -> Bool
$c== :: VolumeMount -> VolumeMount -> Bool
Prelude.Eq, ReadPrec [VolumeMount]
ReadPrec VolumeMount
Int -> ReadS VolumeMount
ReadS [VolumeMount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VolumeMount]
$creadListPrec :: ReadPrec [VolumeMount]
readPrec :: ReadPrec VolumeMount
$creadPrec :: ReadPrec VolumeMount
readList :: ReadS [VolumeMount]
$creadList :: ReadS [VolumeMount]
readsPrec :: Int -> ReadS VolumeMount
$creadsPrec :: Int -> ReadS VolumeMount
Prelude.Read, Int -> VolumeMount -> ShowS
[VolumeMount] -> ShowS
VolumeMount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VolumeMount] -> ShowS
$cshowList :: [VolumeMount] -> ShowS
show :: VolumeMount -> String
$cshow :: VolumeMount -> String
showsPrec :: Int -> VolumeMount -> ShowS
$cshowsPrec :: Int -> VolumeMount -> ShowS
Prelude.Show, forall x. Rep VolumeMount x -> VolumeMount
forall x. VolumeMount -> Rep VolumeMount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VolumeMount x -> VolumeMount
$cfrom :: forall x. VolumeMount -> Rep VolumeMount x
Prelude.Generic)

-- |
-- Create a value of 'VolumeMount' 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:
--
-- 'mountPath', 'volumeMount_mountPath' - Volume mount path.
--
-- 'name', 'volumeMount_name' - Volume mount name.
newVolumeMount ::
  VolumeMount
newVolumeMount :: VolumeMount
newVolumeMount =
  VolumeMount'
    { $sel:mountPath:VolumeMount' :: Maybe Text
mountPath = forall a. Maybe a
Prelude.Nothing,
      $sel:name:VolumeMount' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | Volume mount path.
volumeMount_mountPath :: Lens.Lens' VolumeMount (Prelude.Maybe Prelude.Text)
volumeMount_mountPath :: Lens' VolumeMount (Maybe Text)
volumeMount_mountPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeMount' {Maybe Text
mountPath :: Maybe Text
$sel:mountPath:VolumeMount' :: VolumeMount -> Maybe Text
mountPath} -> Maybe Text
mountPath) (\s :: VolumeMount
s@VolumeMount' {} Maybe Text
a -> VolumeMount
s {$sel:mountPath:VolumeMount' :: Maybe Text
mountPath = Maybe Text
a} :: VolumeMount)

-- | Volume mount name.
volumeMount_name :: Lens.Lens' VolumeMount (Prelude.Maybe Prelude.Text)
volumeMount_name :: Lens' VolumeMount (Maybe Text)
volumeMount_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VolumeMount' {Maybe Text
name :: Maybe Text
$sel:name:VolumeMount' :: VolumeMount -> Maybe Text
name} -> Maybe Text
name) (\s :: VolumeMount
s@VolumeMount' {} Maybe Text
a -> VolumeMount
s {$sel:name:VolumeMount' :: Maybe Text
name = Maybe Text
a} :: VolumeMount)

instance Data.FromJSON VolumeMount where
  parseJSON :: Value -> Parser VolumeMount
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VolumeMount"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> VolumeMount
VolumeMount'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"mountPath")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
      )

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

instance Prelude.NFData VolumeMount where
  rnf :: VolumeMount -> ()
rnf VolumeMount' {Maybe Text
name :: Maybe Text
mountPath :: Maybe Text
$sel:name:VolumeMount' :: VolumeMount -> Maybe Text
$sel:mountPath:VolumeMount' :: VolumeMount -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
mountPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name