{-# 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.IoTFleetWise.Types.FormattedVss
-- 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.IoTFleetWise.Types.FormattedVss 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

-- | Vehicle Signal Specification (VSS) is a precise language used to
-- describe and model signals in vehicle networks. The JSON file collects
-- signal specificiations in a VSS format.
--
-- /See:/ 'newFormattedVss' smart constructor.
data FormattedVss = FormattedVss'
  { -- | Provides the VSS in JSON format.
    FormattedVss -> Maybe Text
vssJson :: Prelude.Maybe Prelude.Text
  }
  deriving (FormattedVss -> FormattedVss -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FormattedVss -> FormattedVss -> Bool
$c/= :: FormattedVss -> FormattedVss -> Bool
== :: FormattedVss -> FormattedVss -> Bool
$c== :: FormattedVss -> FormattedVss -> Bool
Prelude.Eq, ReadPrec [FormattedVss]
ReadPrec FormattedVss
Int -> ReadS FormattedVss
ReadS [FormattedVss]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FormattedVss]
$creadListPrec :: ReadPrec [FormattedVss]
readPrec :: ReadPrec FormattedVss
$creadPrec :: ReadPrec FormattedVss
readList :: ReadS [FormattedVss]
$creadList :: ReadS [FormattedVss]
readsPrec :: Int -> ReadS FormattedVss
$creadsPrec :: Int -> ReadS FormattedVss
Prelude.Read, Int -> FormattedVss -> ShowS
[FormattedVss] -> ShowS
FormattedVss -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FormattedVss] -> ShowS
$cshowList :: [FormattedVss] -> ShowS
show :: FormattedVss -> String
$cshow :: FormattedVss -> String
showsPrec :: Int -> FormattedVss -> ShowS
$cshowsPrec :: Int -> FormattedVss -> ShowS
Prelude.Show, forall x. Rep FormattedVss x -> FormattedVss
forall x. FormattedVss -> Rep FormattedVss x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FormattedVss x -> FormattedVss
$cfrom :: forall x. FormattedVss -> Rep FormattedVss x
Prelude.Generic)

-- |
-- Create a value of 'FormattedVss' 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:
--
-- 'vssJson', 'formattedVss_vssJson' - Provides the VSS in JSON format.
newFormattedVss ::
  FormattedVss
newFormattedVss :: FormattedVss
newFormattedVss =
  FormattedVss' {$sel:vssJson:FormattedVss' :: Maybe Text
vssJson = forall a. Maybe a
Prelude.Nothing}

-- | Provides the VSS in JSON format.
formattedVss_vssJson :: Lens.Lens' FormattedVss (Prelude.Maybe Prelude.Text)
formattedVss_vssJson :: Lens' FormattedVss (Maybe Text)
formattedVss_vssJson = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FormattedVss' {Maybe Text
vssJson :: Maybe Text
$sel:vssJson:FormattedVss' :: FormattedVss -> Maybe Text
vssJson} -> Maybe Text
vssJson) (\s :: FormattedVss
s@FormattedVss' {} Maybe Text
a -> FormattedVss
s {$sel:vssJson:FormattedVss' :: Maybe Text
vssJson = Maybe Text
a} :: FormattedVss)

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

instance Prelude.NFData FormattedVss where
  rnf :: FormattedVss -> ()
rnf FormattedVss' {Maybe Text
vssJson :: Maybe Text
$sel:vssJson:FormattedVss' :: FormattedVss -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vssJson

instance Data.ToJSON FormattedVss where
  toJSON :: FormattedVss -> Value
toJSON FormattedVss' {Maybe Text
vssJson :: Maybe Text
$sel:vssJson:FormattedVss' :: FormattedVss -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"vssJson" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vssJson]
      )