{-# 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.MGN.Types.OS
-- 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.MGN.Types.OS where

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

-- | Operating System.
--
-- /See:/ 'newOS' smart constructor.
data OS = OS'
  { -- | OS full string.
    OS -> Maybe Text
fullString :: Prelude.Maybe Prelude.Text
  }
  deriving (OS -> OS -> Bool
(OS -> OS -> Bool) -> (OS -> OS -> Bool) -> Eq OS
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OS -> OS -> Bool
$c/= :: OS -> OS -> Bool
== :: OS -> OS -> Bool
$c== :: OS -> OS -> Bool
Prelude.Eq, ReadPrec [OS]
ReadPrec OS
Int -> ReadS OS
ReadS [OS]
(Int -> ReadS OS)
-> ReadS [OS] -> ReadPrec OS -> ReadPrec [OS] -> Read OS
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OS]
$creadListPrec :: ReadPrec [OS]
readPrec :: ReadPrec OS
$creadPrec :: ReadPrec OS
readList :: ReadS [OS]
$creadList :: ReadS [OS]
readsPrec :: Int -> ReadS OS
$creadsPrec :: Int -> ReadS OS
Prelude.Read, Int -> OS -> ShowS
[OS] -> ShowS
OS -> String
(Int -> OS -> ShowS)
-> (OS -> String) -> ([OS] -> ShowS) -> Show OS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OS] -> ShowS
$cshowList :: [OS] -> ShowS
show :: OS -> String
$cshow :: OS -> String
showsPrec :: Int -> OS -> ShowS
$cshowsPrec :: Int -> OS -> ShowS
Prelude.Show, (forall x. OS -> Rep OS x)
-> (forall x. Rep OS x -> OS) -> Generic OS
forall x. Rep OS x -> OS
forall x. OS -> Rep OS x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OS x -> OS
$cfrom :: forall x. OS -> Rep OS x
Prelude.Generic)

-- |
-- Create a value of 'OS' 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:
--
-- 'fullString', 'os_fullString' - OS full string.
newOS ::
  OS
newOS :: OS
newOS = OS' :: Maybe Text -> OS
OS' {$sel:fullString:OS' :: Maybe Text
fullString = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | OS full string.
os_fullString :: Lens.Lens' OS (Prelude.Maybe Prelude.Text)
os_fullString :: (Maybe Text -> f (Maybe Text)) -> OS -> f OS
os_fullString = (OS -> Maybe Text)
-> (OS -> Maybe Text -> OS) -> Lens OS OS (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OS' {Maybe Text
fullString :: Maybe Text
$sel:fullString:OS' :: OS -> Maybe Text
fullString} -> Maybe Text
fullString) (\s :: OS
s@OS' {} Maybe Text
a -> OS
s {$sel:fullString:OS' :: Maybe Text
fullString = Maybe Text
a} :: OS)

instance Core.FromJSON OS where
  parseJSON :: Value -> Parser OS
parseJSON =
    String -> (Object -> Parser OS) -> Value -> Parser OS
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"OS"
      (\Object
x -> Maybe Text -> OS
OS' (Maybe Text -> OS) -> Parser (Maybe Text) -> Parser OS
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
"fullString"))

instance Prelude.Hashable OS

instance Prelude.NFData OS