{-# 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 #-}
module Amazonka.CodeDeploy.Types.RawString where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RawString = RawString'
{
RawString -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
RawString -> Maybe Text
sha256 :: Prelude.Maybe Prelude.Text
}
deriving (RawString -> RawString -> Bool
(RawString -> RawString -> Bool)
-> (RawString -> RawString -> Bool) -> Eq RawString
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RawString -> RawString -> Bool
$c/= :: RawString -> RawString -> Bool
== :: RawString -> RawString -> Bool
$c== :: RawString -> RawString -> Bool
Prelude.Eq, ReadPrec [RawString]
ReadPrec RawString
Int -> ReadS RawString
ReadS [RawString]
(Int -> ReadS RawString)
-> ReadS [RawString]
-> ReadPrec RawString
-> ReadPrec [RawString]
-> Read RawString
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RawString]
$creadListPrec :: ReadPrec [RawString]
readPrec :: ReadPrec RawString
$creadPrec :: ReadPrec RawString
readList :: ReadS [RawString]
$creadList :: ReadS [RawString]
readsPrec :: Int -> ReadS RawString
$creadsPrec :: Int -> ReadS RawString
Prelude.Read, Int -> RawString -> ShowS
[RawString] -> ShowS
RawString -> String
(Int -> RawString -> ShowS)
-> (RawString -> String)
-> ([RawString] -> ShowS)
-> Show RawString
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RawString] -> ShowS
$cshowList :: [RawString] -> ShowS
show :: RawString -> String
$cshow :: RawString -> String
showsPrec :: Int -> RawString -> ShowS
$cshowsPrec :: Int -> RawString -> ShowS
Prelude.Show, (forall x. RawString -> Rep RawString x)
-> (forall x. Rep RawString x -> RawString) -> Generic RawString
forall x. Rep RawString x -> RawString
forall x. RawString -> Rep RawString x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RawString x -> RawString
$cfrom :: forall x. RawString -> Rep RawString x
Prelude.Generic)
newRawString ::
RawString
newRawString :: RawString
newRawString =
RawString' :: Maybe Text -> Maybe Text -> RawString
RawString'
{ $sel:content:RawString' :: Maybe Text
content = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sha256:RawString' :: Maybe Text
sha256 = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
rawString_content :: Lens.Lens' RawString (Prelude.Maybe Prelude.Text)
rawString_content :: (Maybe Text -> f (Maybe Text)) -> RawString -> f RawString
rawString_content = (RawString -> Maybe Text)
-> (RawString -> Maybe Text -> RawString)
-> Lens RawString RawString (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RawString' {Maybe Text
content :: Maybe Text
$sel:content:RawString' :: RawString -> Maybe Text
content} -> Maybe Text
content) (\s :: RawString
s@RawString' {} Maybe Text
a -> RawString
s {$sel:content:RawString' :: Maybe Text
content = Maybe Text
a} :: RawString)
rawString_sha256 :: Lens.Lens' RawString (Prelude.Maybe Prelude.Text)
rawString_sha256 :: (Maybe Text -> f (Maybe Text)) -> RawString -> f RawString
rawString_sha256 = (RawString -> Maybe Text)
-> (RawString -> Maybe Text -> RawString)
-> Lens RawString RawString (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RawString' {Maybe Text
sha256 :: Maybe Text
$sel:sha256:RawString' :: RawString -> Maybe Text
sha256} -> Maybe Text
sha256) (\s :: RawString
s@RawString' {} Maybe Text
a -> RawString
s {$sel:sha256:RawString' :: Maybe Text
sha256 = Maybe Text
a} :: RawString)
instance Core.FromJSON RawString where
parseJSON :: Value -> Parser RawString
parseJSON =
String -> (Object -> Parser RawString) -> Value -> Parser RawString
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RawString"
( \Object
x ->
Maybe Text -> Maybe Text -> RawString
RawString'
(Maybe Text -> Maybe Text -> RawString)
-> Parser (Maybe Text) -> Parser (Maybe Text -> RawString)
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
"content")
Parser (Maybe Text -> RawString)
-> Parser (Maybe Text) -> Parser RawString
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
"sha256")
)
instance Prelude.Hashable RawString
instance Prelude.NFData RawString
instance Core.ToJSON RawString where
toJSON :: RawString -> Value
toJSON RawString' {Maybe Text
sha256 :: Maybe Text
content :: Maybe Text
$sel:sha256:RawString' :: RawString -> Maybe Text
$sel:content:RawString' :: RawString -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"content" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
content,
(Text
"sha256" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sha256
]
)