{-# 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.EMR.Types.StudioSummary
-- 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.EMR.Types.StudioSummary where

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.AuthMode
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details for an Amazon EMR Studio, including ID, Name, VPC, and
-- Description. The details do not include subnets, IAM roles, security
-- groups, or tags associated with the Studio.
--
-- /See:/ 'newStudioSummary' smart constructor.
data StudioSummary = StudioSummary'
  { -- | The time when the Amazon EMR Studio was created.
    StudioSummary -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The ID of the Amazon EMR Studio.
    StudioSummary -> Maybe Text
studioId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Virtual Private Cloud (Amazon VPC) associated with the
    -- Amazon EMR Studio.
    StudioSummary -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The unique access URL of the Amazon EMR Studio.
    StudioSummary -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the Studio authenticates users using IAM or Amazon Web
    -- Services SSO.
    StudioSummary -> Maybe AuthMode
authMode :: Prelude.Maybe AuthMode,
    -- | The name of the Amazon EMR Studio.
    StudioSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The detailed description of the Amazon EMR Studio.
    StudioSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (StudioSummary -> StudioSummary -> Bool
(StudioSummary -> StudioSummary -> Bool)
-> (StudioSummary -> StudioSummary -> Bool) -> Eq StudioSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StudioSummary -> StudioSummary -> Bool
$c/= :: StudioSummary -> StudioSummary -> Bool
== :: StudioSummary -> StudioSummary -> Bool
$c== :: StudioSummary -> StudioSummary -> Bool
Prelude.Eq, ReadPrec [StudioSummary]
ReadPrec StudioSummary
Int -> ReadS StudioSummary
ReadS [StudioSummary]
(Int -> ReadS StudioSummary)
-> ReadS [StudioSummary]
-> ReadPrec StudioSummary
-> ReadPrec [StudioSummary]
-> Read StudioSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StudioSummary]
$creadListPrec :: ReadPrec [StudioSummary]
readPrec :: ReadPrec StudioSummary
$creadPrec :: ReadPrec StudioSummary
readList :: ReadS [StudioSummary]
$creadList :: ReadS [StudioSummary]
readsPrec :: Int -> ReadS StudioSummary
$creadsPrec :: Int -> ReadS StudioSummary
Prelude.Read, Int -> StudioSummary -> ShowS
[StudioSummary] -> ShowS
StudioSummary -> String
(Int -> StudioSummary -> ShowS)
-> (StudioSummary -> String)
-> ([StudioSummary] -> ShowS)
-> Show StudioSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StudioSummary] -> ShowS
$cshowList :: [StudioSummary] -> ShowS
show :: StudioSummary -> String
$cshow :: StudioSummary -> String
showsPrec :: Int -> StudioSummary -> ShowS
$cshowsPrec :: Int -> StudioSummary -> ShowS
Prelude.Show, (forall x. StudioSummary -> Rep StudioSummary x)
-> (forall x. Rep StudioSummary x -> StudioSummary)
-> Generic StudioSummary
forall x. Rep StudioSummary x -> StudioSummary
forall x. StudioSummary -> Rep StudioSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StudioSummary x -> StudioSummary
$cfrom :: forall x. StudioSummary -> Rep StudioSummary x
Prelude.Generic)

-- |
-- Create a value of 'StudioSummary' 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:
--
-- 'creationTime', 'studioSummary_creationTime' - The time when the Amazon EMR Studio was created.
--
-- 'studioId', 'studioSummary_studioId' - The ID of the Amazon EMR Studio.
--
-- 'vpcId', 'studioSummary_vpcId' - The ID of the Virtual Private Cloud (Amazon VPC) associated with the
-- Amazon EMR Studio.
--
-- 'url', 'studioSummary_url' - The unique access URL of the Amazon EMR Studio.
--
-- 'authMode', 'studioSummary_authMode' - Specifies whether the Studio authenticates users using IAM or Amazon Web
-- Services SSO.
--
-- 'name', 'studioSummary_name' - The name of the Amazon EMR Studio.
--
-- 'description', 'studioSummary_description' - The detailed description of the Amazon EMR Studio.
newStudioSummary ::
  StudioSummary
newStudioSummary :: StudioSummary
newStudioSummary =
  StudioSummary' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AuthMode
-> Maybe Text
-> Maybe Text
-> StudioSummary
StudioSummary'
    { $sel:creationTime:StudioSummary' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:studioId:StudioSummary' :: Maybe Text
studioId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:StudioSummary' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:url:StudioSummary' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authMode:StudioSummary' :: Maybe AuthMode
authMode = Maybe AuthMode
forall a. Maybe a
Prelude.Nothing,
      $sel:name:StudioSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:StudioSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time when the Amazon EMR Studio was created.
studioSummary_creationTime :: Lens.Lens' StudioSummary (Prelude.Maybe Prelude.UTCTime)
studioSummary_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StudioSummary -> f StudioSummary
studioSummary_creationTime = (StudioSummary -> Maybe POSIX)
-> (StudioSummary -> Maybe POSIX -> StudioSummary)
-> Lens StudioSummary StudioSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:StudioSummary' :: StudioSummary -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: StudioSummary
s@StudioSummary' {} Maybe POSIX
a -> StudioSummary
s {$sel:creationTime:StudioSummary' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: StudioSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> StudioSummary -> f StudioSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StudioSummary
-> f StudioSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the Amazon EMR Studio.
studioSummary_studioId :: Lens.Lens' StudioSummary (Prelude.Maybe Prelude.Text)
studioSummary_studioId :: (Maybe Text -> f (Maybe Text)) -> StudioSummary -> f StudioSummary
studioSummary_studioId = (StudioSummary -> Maybe Text)
-> (StudioSummary -> Maybe Text -> StudioSummary)
-> Lens StudioSummary StudioSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe Text
studioId :: Maybe Text
$sel:studioId:StudioSummary' :: StudioSummary -> Maybe Text
studioId} -> Maybe Text
studioId) (\s :: StudioSummary
s@StudioSummary' {} Maybe Text
a -> StudioSummary
s {$sel:studioId:StudioSummary' :: Maybe Text
studioId = Maybe Text
a} :: StudioSummary)

-- | The ID of the Virtual Private Cloud (Amazon VPC) associated with the
-- Amazon EMR Studio.
studioSummary_vpcId :: Lens.Lens' StudioSummary (Prelude.Maybe Prelude.Text)
studioSummary_vpcId :: (Maybe Text -> f (Maybe Text)) -> StudioSummary -> f StudioSummary
studioSummary_vpcId = (StudioSummary -> Maybe Text)
-> (StudioSummary -> Maybe Text -> StudioSummary)
-> Lens StudioSummary StudioSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:StudioSummary' :: StudioSummary -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: StudioSummary
s@StudioSummary' {} Maybe Text
a -> StudioSummary
s {$sel:vpcId:StudioSummary' :: Maybe Text
vpcId = Maybe Text
a} :: StudioSummary)

-- | The unique access URL of the Amazon EMR Studio.
studioSummary_url :: Lens.Lens' StudioSummary (Prelude.Maybe Prelude.Text)
studioSummary_url :: (Maybe Text -> f (Maybe Text)) -> StudioSummary -> f StudioSummary
studioSummary_url = (StudioSummary -> Maybe Text)
-> (StudioSummary -> Maybe Text -> StudioSummary)
-> Lens StudioSummary StudioSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe Text
url :: Maybe Text
$sel:url:StudioSummary' :: StudioSummary -> Maybe Text
url} -> Maybe Text
url) (\s :: StudioSummary
s@StudioSummary' {} Maybe Text
a -> StudioSummary
s {$sel:url:StudioSummary' :: Maybe Text
url = Maybe Text
a} :: StudioSummary)

-- | Specifies whether the Studio authenticates users using IAM or Amazon Web
-- Services SSO.
studioSummary_authMode :: Lens.Lens' StudioSummary (Prelude.Maybe AuthMode)
studioSummary_authMode :: (Maybe AuthMode -> f (Maybe AuthMode))
-> StudioSummary -> f StudioSummary
studioSummary_authMode = (StudioSummary -> Maybe AuthMode)
-> (StudioSummary -> Maybe AuthMode -> StudioSummary)
-> Lens
     StudioSummary StudioSummary (Maybe AuthMode) (Maybe AuthMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe AuthMode
authMode :: Maybe AuthMode
$sel:authMode:StudioSummary' :: StudioSummary -> Maybe AuthMode
authMode} -> Maybe AuthMode
authMode) (\s :: StudioSummary
s@StudioSummary' {} Maybe AuthMode
a -> StudioSummary
s {$sel:authMode:StudioSummary' :: Maybe AuthMode
authMode = Maybe AuthMode
a} :: StudioSummary)

-- | The name of the Amazon EMR Studio.
studioSummary_name :: Lens.Lens' StudioSummary (Prelude.Maybe Prelude.Text)
studioSummary_name :: (Maybe Text -> f (Maybe Text)) -> StudioSummary -> f StudioSummary
studioSummary_name = (StudioSummary -> Maybe Text)
-> (StudioSummary -> Maybe Text -> StudioSummary)
-> Lens StudioSummary StudioSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe Text
name :: Maybe Text
$sel:name:StudioSummary' :: StudioSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: StudioSummary
s@StudioSummary' {} Maybe Text
a -> StudioSummary
s {$sel:name:StudioSummary' :: Maybe Text
name = Maybe Text
a} :: StudioSummary)

-- | The detailed description of the Amazon EMR Studio.
studioSummary_description :: Lens.Lens' StudioSummary (Prelude.Maybe Prelude.Text)
studioSummary_description :: (Maybe Text -> f (Maybe Text)) -> StudioSummary -> f StudioSummary
studioSummary_description = (StudioSummary -> Maybe Text)
-> (StudioSummary -> Maybe Text -> StudioSummary)
-> Lens StudioSummary StudioSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StudioSummary' {Maybe Text
description :: Maybe Text
$sel:description:StudioSummary' :: StudioSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: StudioSummary
s@StudioSummary' {} Maybe Text
a -> StudioSummary
s {$sel:description:StudioSummary' :: Maybe Text
description = Maybe Text
a} :: StudioSummary)

instance Core.FromJSON StudioSummary where
  parseJSON :: Value -> Parser StudioSummary
parseJSON =
    String
-> (Object -> Parser StudioSummary)
-> Value
-> Parser StudioSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"StudioSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AuthMode
-> Maybe Text
-> Maybe Text
-> StudioSummary
StudioSummary'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe AuthMode
 -> Maybe Text
 -> Maybe Text
 -> StudioSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe AuthMode
      -> Maybe Text
      -> Maybe Text
      -> StudioSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe AuthMode
   -> Maybe Text
   -> Maybe Text
   -> StudioSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe AuthMode
      -> Maybe Text
      -> Maybe Text
      -> StudioSummary)
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
"StudioId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe AuthMode
   -> Maybe Text
   -> Maybe Text
   -> StudioSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe AuthMode -> Maybe Text -> Maybe Text -> StudioSummary)
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
"VpcId")
            Parser
  (Maybe Text
   -> Maybe AuthMode -> Maybe Text -> Maybe Text -> StudioSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe AuthMode -> Maybe Text -> Maybe Text -> StudioSummary)
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
"Url")
            Parser
  (Maybe AuthMode -> Maybe Text -> Maybe Text -> StudioSummary)
-> Parser (Maybe AuthMode)
-> Parser (Maybe Text -> Maybe Text -> StudioSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuthMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AuthMode")
            Parser (Maybe Text -> Maybe Text -> StudioSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> StudioSummary)
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
"Name")
            Parser (Maybe Text -> StudioSummary)
-> Parser (Maybe Text) -> Parser StudioSummary
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
"Description")
      )

instance Prelude.Hashable StudioSummary

instance Prelude.NFData StudioSummary