{-# 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.FSx.Types.FileSystemEndpoints
-- 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.FSx.Types.FileSystemEndpoints where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.FSx.Types.FileSystemEndpoint
import qualified Amazonka.Prelude as Prelude

-- | An Amazon FSx for NetApp ONTAP file system has the following endpoints
-- that are used to access data or to manage the file system using the
-- NetApp ONTAP CLI, REST API, or NetApp SnapMirror.
--
-- /See:/ 'newFileSystemEndpoints' smart constructor.
data FileSystemEndpoints = FileSystemEndpoints'
  { -- | An endpoint for managing your file system by setting up NetApp
    -- SnapMirror with other ONTAP systems.
    FileSystemEndpoints -> Maybe FileSystemEndpoint
intercluster :: Prelude.Maybe FileSystemEndpoint,
    -- | An endpoint for managing your file system using the NetApp ONTAP CLI and
    -- NetApp ONTAP API.
    FileSystemEndpoints -> Maybe FileSystemEndpoint
management :: Prelude.Maybe FileSystemEndpoint
  }
  deriving (FileSystemEndpoints -> FileSystemEndpoints -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileSystemEndpoints -> FileSystemEndpoints -> Bool
$c/= :: FileSystemEndpoints -> FileSystemEndpoints -> Bool
== :: FileSystemEndpoints -> FileSystemEndpoints -> Bool
$c== :: FileSystemEndpoints -> FileSystemEndpoints -> Bool
Prelude.Eq, ReadPrec [FileSystemEndpoints]
ReadPrec FileSystemEndpoints
Int -> ReadS FileSystemEndpoints
ReadS [FileSystemEndpoints]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileSystemEndpoints]
$creadListPrec :: ReadPrec [FileSystemEndpoints]
readPrec :: ReadPrec FileSystemEndpoints
$creadPrec :: ReadPrec FileSystemEndpoints
readList :: ReadS [FileSystemEndpoints]
$creadList :: ReadS [FileSystemEndpoints]
readsPrec :: Int -> ReadS FileSystemEndpoints
$creadsPrec :: Int -> ReadS FileSystemEndpoints
Prelude.Read, Int -> FileSystemEndpoints -> ShowS
[FileSystemEndpoints] -> ShowS
FileSystemEndpoints -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileSystemEndpoints] -> ShowS
$cshowList :: [FileSystemEndpoints] -> ShowS
show :: FileSystemEndpoints -> String
$cshow :: FileSystemEndpoints -> String
showsPrec :: Int -> FileSystemEndpoints -> ShowS
$cshowsPrec :: Int -> FileSystemEndpoints -> ShowS
Prelude.Show, forall x. Rep FileSystemEndpoints x -> FileSystemEndpoints
forall x. FileSystemEndpoints -> Rep FileSystemEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileSystemEndpoints x -> FileSystemEndpoints
$cfrom :: forall x. FileSystemEndpoints -> Rep FileSystemEndpoints x
Prelude.Generic)

-- |
-- Create a value of 'FileSystemEndpoints' 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:
--
-- 'intercluster', 'fileSystemEndpoints_intercluster' - An endpoint for managing your file system by setting up NetApp
-- SnapMirror with other ONTAP systems.
--
-- 'management', 'fileSystemEndpoints_management' - An endpoint for managing your file system using the NetApp ONTAP CLI and
-- NetApp ONTAP API.
newFileSystemEndpoints ::
  FileSystemEndpoints
newFileSystemEndpoints :: FileSystemEndpoints
newFileSystemEndpoints =
  FileSystemEndpoints'
    { $sel:intercluster:FileSystemEndpoints' :: Maybe FileSystemEndpoint
intercluster =
        forall a. Maybe a
Prelude.Nothing,
      $sel:management:FileSystemEndpoints' :: Maybe FileSystemEndpoint
management = forall a. Maybe a
Prelude.Nothing
    }

-- | An endpoint for managing your file system by setting up NetApp
-- SnapMirror with other ONTAP systems.
fileSystemEndpoints_intercluster :: Lens.Lens' FileSystemEndpoints (Prelude.Maybe FileSystemEndpoint)
fileSystemEndpoints_intercluster :: Lens' FileSystemEndpoints (Maybe FileSystemEndpoint)
fileSystemEndpoints_intercluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemEndpoints' {Maybe FileSystemEndpoint
intercluster :: Maybe FileSystemEndpoint
$sel:intercluster:FileSystemEndpoints' :: FileSystemEndpoints -> Maybe FileSystemEndpoint
intercluster} -> Maybe FileSystemEndpoint
intercluster) (\s :: FileSystemEndpoints
s@FileSystemEndpoints' {} Maybe FileSystemEndpoint
a -> FileSystemEndpoints
s {$sel:intercluster:FileSystemEndpoints' :: Maybe FileSystemEndpoint
intercluster = Maybe FileSystemEndpoint
a} :: FileSystemEndpoints)

-- | An endpoint for managing your file system using the NetApp ONTAP CLI and
-- NetApp ONTAP API.
fileSystemEndpoints_management :: Lens.Lens' FileSystemEndpoints (Prelude.Maybe FileSystemEndpoint)
fileSystemEndpoints_management :: Lens' FileSystemEndpoints (Maybe FileSystemEndpoint)
fileSystemEndpoints_management = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemEndpoints' {Maybe FileSystemEndpoint
management :: Maybe FileSystemEndpoint
$sel:management:FileSystemEndpoints' :: FileSystemEndpoints -> Maybe FileSystemEndpoint
management} -> Maybe FileSystemEndpoint
management) (\s :: FileSystemEndpoints
s@FileSystemEndpoints' {} Maybe FileSystemEndpoint
a -> FileSystemEndpoints
s {$sel:management:FileSystemEndpoints' :: Maybe FileSystemEndpoint
management = Maybe FileSystemEndpoint
a} :: FileSystemEndpoints)

instance Data.FromJSON FileSystemEndpoints where
  parseJSON :: Value -> Parser FileSystemEndpoints
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FileSystemEndpoints"
      ( \Object
x ->
          Maybe FileSystemEndpoint
-> Maybe FileSystemEndpoint -> FileSystemEndpoints
FileSystemEndpoints'
            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
"Intercluster")
            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
"Management")
      )

instance Prelude.Hashable FileSystemEndpoints where
  hashWithSalt :: Int -> FileSystemEndpoints -> Int
hashWithSalt Int
_salt FileSystemEndpoints' {Maybe FileSystemEndpoint
management :: Maybe FileSystemEndpoint
intercluster :: Maybe FileSystemEndpoint
$sel:management:FileSystemEndpoints' :: FileSystemEndpoints -> Maybe FileSystemEndpoint
$sel:intercluster:FileSystemEndpoints' :: FileSystemEndpoints -> Maybe FileSystemEndpoint
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileSystemEndpoint
intercluster
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FileSystemEndpoint
management

instance Prelude.NFData FileSystemEndpoints where
  rnf :: FileSystemEndpoints -> ()
rnf FileSystemEndpoints' {Maybe FileSystemEndpoint
management :: Maybe FileSystemEndpoint
intercluster :: Maybe FileSystemEndpoint
$sel:management:FileSystemEndpoints' :: FileSystemEndpoints -> Maybe FileSystemEndpoint
$sel:intercluster:FileSystemEndpoints' :: FileSystemEndpoints -> Maybe FileSystemEndpoint
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FileSystemEndpoint
intercluster
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FileSystemEndpoint
management