{-# 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.SSM.Types.DocumentDefaultVersionDescription
-- 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.SSM.Types.DocumentDefaultVersionDescription where

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

-- | A default version of a document.
--
-- /See:/ 'newDocumentDefaultVersionDescription' smart constructor.
data DocumentDefaultVersionDescription = DocumentDefaultVersionDescription'
  { -- | The default version of the artifact associated with the document.
    DocumentDefaultVersionDescription -> Maybe Text
defaultVersionName :: Prelude.Maybe Prelude.Text,
    -- | The default version of the document.
    DocumentDefaultVersionDescription -> Maybe Text
defaultVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the document.
    DocumentDefaultVersionDescription -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (DocumentDefaultVersionDescription
-> DocumentDefaultVersionDescription -> Bool
(DocumentDefaultVersionDescription
 -> DocumentDefaultVersionDescription -> Bool)
-> (DocumentDefaultVersionDescription
    -> DocumentDefaultVersionDescription -> Bool)
-> Eq DocumentDefaultVersionDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentDefaultVersionDescription
-> DocumentDefaultVersionDescription -> Bool
$c/= :: DocumentDefaultVersionDescription
-> DocumentDefaultVersionDescription -> Bool
== :: DocumentDefaultVersionDescription
-> DocumentDefaultVersionDescription -> Bool
$c== :: DocumentDefaultVersionDescription
-> DocumentDefaultVersionDescription -> Bool
Prelude.Eq, ReadPrec [DocumentDefaultVersionDescription]
ReadPrec DocumentDefaultVersionDescription
Int -> ReadS DocumentDefaultVersionDescription
ReadS [DocumentDefaultVersionDescription]
(Int -> ReadS DocumentDefaultVersionDescription)
-> ReadS [DocumentDefaultVersionDescription]
-> ReadPrec DocumentDefaultVersionDescription
-> ReadPrec [DocumentDefaultVersionDescription]
-> Read DocumentDefaultVersionDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentDefaultVersionDescription]
$creadListPrec :: ReadPrec [DocumentDefaultVersionDescription]
readPrec :: ReadPrec DocumentDefaultVersionDescription
$creadPrec :: ReadPrec DocumentDefaultVersionDescription
readList :: ReadS [DocumentDefaultVersionDescription]
$creadList :: ReadS [DocumentDefaultVersionDescription]
readsPrec :: Int -> ReadS DocumentDefaultVersionDescription
$creadsPrec :: Int -> ReadS DocumentDefaultVersionDescription
Prelude.Read, Int -> DocumentDefaultVersionDescription -> ShowS
[DocumentDefaultVersionDescription] -> ShowS
DocumentDefaultVersionDescription -> String
(Int -> DocumentDefaultVersionDescription -> ShowS)
-> (DocumentDefaultVersionDescription -> String)
-> ([DocumentDefaultVersionDescription] -> ShowS)
-> Show DocumentDefaultVersionDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentDefaultVersionDescription] -> ShowS
$cshowList :: [DocumentDefaultVersionDescription] -> ShowS
show :: DocumentDefaultVersionDescription -> String
$cshow :: DocumentDefaultVersionDescription -> String
showsPrec :: Int -> DocumentDefaultVersionDescription -> ShowS
$cshowsPrec :: Int -> DocumentDefaultVersionDescription -> ShowS
Prelude.Show, (forall x.
 DocumentDefaultVersionDescription
 -> Rep DocumentDefaultVersionDescription x)
-> (forall x.
    Rep DocumentDefaultVersionDescription x
    -> DocumentDefaultVersionDescription)
-> Generic DocumentDefaultVersionDescription
forall x.
Rep DocumentDefaultVersionDescription x
-> DocumentDefaultVersionDescription
forall x.
DocumentDefaultVersionDescription
-> Rep DocumentDefaultVersionDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentDefaultVersionDescription x
-> DocumentDefaultVersionDescription
$cfrom :: forall x.
DocumentDefaultVersionDescription
-> Rep DocumentDefaultVersionDescription x
Prelude.Generic)

-- |
-- Create a value of 'DocumentDefaultVersionDescription' 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:
--
-- 'defaultVersionName', 'documentDefaultVersionDescription_defaultVersionName' - The default version of the artifact associated with the document.
--
-- 'defaultVersion', 'documentDefaultVersionDescription_defaultVersion' - The default version of the document.
--
-- 'name', 'documentDefaultVersionDescription_name' - The name of the document.
newDocumentDefaultVersionDescription ::
  DocumentDefaultVersionDescription
newDocumentDefaultVersionDescription :: DocumentDefaultVersionDescription
newDocumentDefaultVersionDescription =
  DocumentDefaultVersionDescription' :: Maybe Text
-> Maybe Text -> Maybe Text -> DocumentDefaultVersionDescription
DocumentDefaultVersionDescription'
    { $sel:defaultVersionName:DocumentDefaultVersionDescription' :: Maybe Text
defaultVersionName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultVersion:DocumentDefaultVersionDescription' :: Maybe Text
defaultVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:DocumentDefaultVersionDescription' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The default version of the artifact associated with the document.
documentDefaultVersionDescription_defaultVersionName :: Lens.Lens' DocumentDefaultVersionDescription (Prelude.Maybe Prelude.Text)
documentDefaultVersionDescription_defaultVersionName :: (Maybe Text -> f (Maybe Text))
-> DocumentDefaultVersionDescription
-> f DocumentDefaultVersionDescription
documentDefaultVersionDescription_defaultVersionName = (DocumentDefaultVersionDescription -> Maybe Text)
-> (DocumentDefaultVersionDescription
    -> Maybe Text -> DocumentDefaultVersionDescription)
-> Lens
     DocumentDefaultVersionDescription
     DocumentDefaultVersionDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentDefaultVersionDescription' {Maybe Text
defaultVersionName :: Maybe Text
$sel:defaultVersionName:DocumentDefaultVersionDescription' :: DocumentDefaultVersionDescription -> Maybe Text
defaultVersionName} -> Maybe Text
defaultVersionName) (\s :: DocumentDefaultVersionDescription
s@DocumentDefaultVersionDescription' {} Maybe Text
a -> DocumentDefaultVersionDescription
s {$sel:defaultVersionName:DocumentDefaultVersionDescription' :: Maybe Text
defaultVersionName = Maybe Text
a} :: DocumentDefaultVersionDescription)

-- | The default version of the document.
documentDefaultVersionDescription_defaultVersion :: Lens.Lens' DocumentDefaultVersionDescription (Prelude.Maybe Prelude.Text)
documentDefaultVersionDescription_defaultVersion :: (Maybe Text -> f (Maybe Text))
-> DocumentDefaultVersionDescription
-> f DocumentDefaultVersionDescription
documentDefaultVersionDescription_defaultVersion = (DocumentDefaultVersionDescription -> Maybe Text)
-> (DocumentDefaultVersionDescription
    -> Maybe Text -> DocumentDefaultVersionDescription)
-> Lens
     DocumentDefaultVersionDescription
     DocumentDefaultVersionDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentDefaultVersionDescription' {Maybe Text
defaultVersion :: Maybe Text
$sel:defaultVersion:DocumentDefaultVersionDescription' :: DocumentDefaultVersionDescription -> Maybe Text
defaultVersion} -> Maybe Text
defaultVersion) (\s :: DocumentDefaultVersionDescription
s@DocumentDefaultVersionDescription' {} Maybe Text
a -> DocumentDefaultVersionDescription
s {$sel:defaultVersion:DocumentDefaultVersionDescription' :: Maybe Text
defaultVersion = Maybe Text
a} :: DocumentDefaultVersionDescription)

-- | The name of the document.
documentDefaultVersionDescription_name :: Lens.Lens' DocumentDefaultVersionDescription (Prelude.Maybe Prelude.Text)
documentDefaultVersionDescription_name :: (Maybe Text -> f (Maybe Text))
-> DocumentDefaultVersionDescription
-> f DocumentDefaultVersionDescription
documentDefaultVersionDescription_name = (DocumentDefaultVersionDescription -> Maybe Text)
-> (DocumentDefaultVersionDescription
    -> Maybe Text -> DocumentDefaultVersionDescription)
-> Lens
     DocumentDefaultVersionDescription
     DocumentDefaultVersionDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentDefaultVersionDescription' {Maybe Text
name :: Maybe Text
$sel:name:DocumentDefaultVersionDescription' :: DocumentDefaultVersionDescription -> Maybe Text
name} -> Maybe Text
name) (\s :: DocumentDefaultVersionDescription
s@DocumentDefaultVersionDescription' {} Maybe Text
a -> DocumentDefaultVersionDescription
s {$sel:name:DocumentDefaultVersionDescription' :: Maybe Text
name = Maybe Text
a} :: DocumentDefaultVersionDescription)

instance
  Core.FromJSON
    DocumentDefaultVersionDescription
  where
  parseJSON :: Value -> Parser DocumentDefaultVersionDescription
parseJSON =
    String
-> (Object -> Parser DocumentDefaultVersionDescription)
-> Value
-> Parser DocumentDefaultVersionDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DocumentDefaultVersionDescription"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> DocumentDefaultVersionDescription
DocumentDefaultVersionDescription'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> DocumentDefaultVersionDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> DocumentDefaultVersionDescription)
forall (f :: * -> *) a b. Functor 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
"DefaultVersionName")
            Parser
  (Maybe Text -> Maybe Text -> DocumentDefaultVersionDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> DocumentDefaultVersionDescription)
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
"DefaultVersion")
            Parser (Maybe Text -> DocumentDefaultVersionDescription)
-> Parser (Maybe Text) -> Parser DocumentDefaultVersionDescription
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")
      )

instance
  Prelude.Hashable
    DocumentDefaultVersionDescription

instance
  Prelude.NFData
    DocumentDefaultVersionDescription